@codyswann/lisa 1.52.2 → 1.52.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/config.d.ts +2 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +5 -0
- package/dist/core/lisa.js.map +1 -1
- package/expo/create-only/.github/workflows/ci.yml +2 -2
- package/expo/create-only/.github/workflows/deploy.yml +1 -1
- package/expo/deletions.json +8 -0
- package/nestjs/create-only/.github/workflows/ci.yml +1 -1
- package/nestjs/create-only/.github/workflows/deploy.yml +1 -1
- package/nestjs/deletions.json +7 -1
- package/package.json +1 -1
- package/typescript/create-only/.github/workflows/auto-update-pr-branches.yml +24 -0
- package/typescript/create-only/.github/workflows/claude-ci-auto-fix.yml +20 -0
- package/typescript/create-only/.github/workflows/claude-code-review-response.yml +20 -0
- package/typescript/create-only/.github/workflows/claude-deploy-auto-fix.yml +20 -0
- package/typescript/create-only/.github/workflows/claude-nightly-code-complexity.yml +14 -0
- package/typescript/create-only/.github/workflows/claude-nightly-test-coverage.yml +14 -0
- package/typescript/create-only/.github/workflows/claude-nightly-test-improvement.yml +25 -0
- package/typescript/create-only/.github/workflows/claude.yml +25 -0
- package/typescript/deletions.json +20 -0
- package/expo/copy-overwrite/.github/workflows/build.yml +0 -75
- package/expo/copy-overwrite/.github/workflows/lighthouse.yml +0 -88
- package/expo/copy-overwrite/.github/workflows/zap-baseline.yml +0 -107
- package/nestjs/copy-overwrite/.github/workflows/load-test.yml +0 -285
- package/nestjs/copy-overwrite/.github/workflows/zap-baseline.yml +0 -123
- package/typescript/copy-overwrite/.github/workflows/auto-update-pr-branches.yml +0 -45
- package/typescript/copy-overwrite/.github/workflows/claude-ci-auto-fix.yml +0 -145
- package/typescript/copy-overwrite/.github/workflows/claude-code-review-response.yml +0 -112
- package/typescript/copy-overwrite/.github/workflows/claude-deploy-auto-fix.yml +0 -143
- package/typescript/copy-overwrite/.github/workflows/claude-nightly-code-complexity.yml +0 -130
- package/typescript/copy-overwrite/.github/workflows/claude-nightly-test-coverage.yml +0 -127
- package/typescript/copy-overwrite/.github/workflows/claude-nightly-test-improvement.yml +0 -129
- package/typescript/copy-overwrite/.github/workflows/claude.yml +0 -55
- package/typescript/copy-overwrite/.github/workflows/create-github-issue-on-failure.yml +0 -115
- package/typescript/copy-overwrite/.github/workflows/create-issue-on-failure.yml +0 -176
- package/typescript/copy-overwrite/.github/workflows/create-jira-issue-on-failure.yml +0 -197
- package/typescript/copy-overwrite/.github/workflows/create-sentry-issue-on-failure.yml +0 -269
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
|
|
4
|
-
name: ZAP Baseline Scan (Expo)
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
workflow_call:
|
|
8
|
-
inputs:
|
|
9
|
-
node_version:
|
|
10
|
-
description: 'Node.js version to use'
|
|
11
|
-
required: false
|
|
12
|
-
default: '22.21.1'
|
|
13
|
-
type: string
|
|
14
|
-
package_manager:
|
|
15
|
-
description: 'Package manager to use (npm, yarn, or bun)'
|
|
16
|
-
required: false
|
|
17
|
-
default: 'bun'
|
|
18
|
-
type: string
|
|
19
|
-
zap_target_url:
|
|
20
|
-
description: 'Override URL for ZAP to scan (default: http://localhost:3000)'
|
|
21
|
-
required: false
|
|
22
|
-
default: 'http://localhost:3000'
|
|
23
|
-
type: string
|
|
24
|
-
zap_rules_file:
|
|
25
|
-
description: 'Path to ZAP rules configuration file'
|
|
26
|
-
required: false
|
|
27
|
-
default: '.zap/baseline.conf'
|
|
28
|
-
type: string
|
|
29
|
-
|
|
30
|
-
jobs:
|
|
31
|
-
zap_baseline:
|
|
32
|
-
name: ZAP Baseline Scan
|
|
33
|
-
runs-on: ubuntu-latest
|
|
34
|
-
timeout-minutes: 20
|
|
35
|
-
|
|
36
|
-
steps:
|
|
37
|
-
- name: Checkout repository
|
|
38
|
-
uses: actions/checkout@v4
|
|
39
|
-
|
|
40
|
-
- name: Setup Node.js
|
|
41
|
-
uses: actions/setup-node@v4
|
|
42
|
-
with:
|
|
43
|
-
node-version: ${{ inputs.node_version }}
|
|
44
|
-
cache: ${{ inputs.package_manager != 'bun' && inputs.package_manager || '' }}
|
|
45
|
-
|
|
46
|
-
- name: Setup Bun
|
|
47
|
-
if: inputs.package_manager == 'bun'
|
|
48
|
-
uses: oven-sh/setup-bun@v2
|
|
49
|
-
with:
|
|
50
|
-
bun-version: '1.3.8'
|
|
51
|
-
|
|
52
|
-
- name: Install dependencies
|
|
53
|
-
run: |
|
|
54
|
-
if [ "${{ inputs.package_manager }}" = "npm" ]; then
|
|
55
|
-
npm ci
|
|
56
|
-
elif [ "${{ inputs.package_manager }}" = "yarn" ]; then
|
|
57
|
-
yarn install --frozen-lockfile
|
|
58
|
-
elif [ "${{ inputs.package_manager }}" = "bun" ]; then
|
|
59
|
-
bun install --frozen-lockfile
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
- name: Build web export
|
|
63
|
-
run: npx expo export --platform web
|
|
64
|
-
|
|
65
|
-
- name: Start static server
|
|
66
|
-
run: |
|
|
67
|
-
npx serve dist -l 3000 &
|
|
68
|
-
SERVER_PID=$!
|
|
69
|
-
echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV
|
|
70
|
-
sleep 5
|
|
71
|
-
curl -sf http://localhost:3000 > /dev/null || (echo "Static server failed to start" && exit 1)
|
|
72
|
-
|
|
73
|
-
- name: Check for ZAP rules file
|
|
74
|
-
id: check_rules
|
|
75
|
-
run: |
|
|
76
|
-
if [ -f "${{ inputs.zap_rules_file }}" ]; then
|
|
77
|
-
echo "has_rules=true" >> $GITHUB_OUTPUT
|
|
78
|
-
else
|
|
79
|
-
echo "has_rules=false" >> $GITHUB_OUTPUT
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
- name: Run ZAP baseline scan
|
|
83
|
-
uses: zaproxy/action-baseline@v0.14.0
|
|
84
|
-
with:
|
|
85
|
-
target: ${{ inputs.zap_target_url }}
|
|
86
|
-
rules_file_name: ${{ steps.check_rules.outputs.has_rules == 'true' && inputs.zap_rules_file || '' }}
|
|
87
|
-
fail_action: true
|
|
88
|
-
allow_issue_writing: false
|
|
89
|
-
artifact_name: 'zap-report-expo'
|
|
90
|
-
|
|
91
|
-
- name: Stop static server
|
|
92
|
-
if: always()
|
|
93
|
-
run: |
|
|
94
|
-
if [ -n "$SERVER_PID" ]; then
|
|
95
|
-
kill "$SERVER_PID" 2>/dev/null || true
|
|
96
|
-
fi
|
|
97
|
-
|
|
98
|
-
- name: Upload ZAP report
|
|
99
|
-
if: always()
|
|
100
|
-
uses: actions/upload-artifact@v4
|
|
101
|
-
with:
|
|
102
|
-
name: zap-baseline-report-expo-${{ github.run_id }}
|
|
103
|
-
path: |
|
|
104
|
-
zap-report.html
|
|
105
|
-
zap-report.json
|
|
106
|
-
zap-report.md
|
|
107
|
-
retention-days: 14
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
|
|
4
|
-
name: K6 Load Testing
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
workflow_call:
|
|
8
|
-
inputs:
|
|
9
|
-
environment:
|
|
10
|
-
description: 'Target environment to test'
|
|
11
|
-
required: true
|
|
12
|
-
type: string
|
|
13
|
-
test_scenario:
|
|
14
|
-
description: 'Test scenario to run (smoke, load, stress, spike, soak)'
|
|
15
|
-
required: false
|
|
16
|
-
type: string
|
|
17
|
-
default: 'smoke'
|
|
18
|
-
base_url:
|
|
19
|
-
description: 'Base URL of the application to test'
|
|
20
|
-
required: true
|
|
21
|
-
type: string
|
|
22
|
-
k6_version:
|
|
23
|
-
description: 'k6 version to use'
|
|
24
|
-
required: false
|
|
25
|
-
type: string
|
|
26
|
-
default: 'latest'
|
|
27
|
-
test_duration:
|
|
28
|
-
description: 'Override test duration (e.g., 5m, 1h)'
|
|
29
|
-
required: false
|
|
30
|
-
type: string
|
|
31
|
-
virtual_users:
|
|
32
|
-
description: 'Override number of virtual users'
|
|
33
|
-
required: false
|
|
34
|
-
type: number
|
|
35
|
-
thresholds_config:
|
|
36
|
-
description: 'Path to custom thresholds configuration'
|
|
37
|
-
required: false
|
|
38
|
-
type: string
|
|
39
|
-
test_script:
|
|
40
|
-
description: 'Path to custom k6 test script'
|
|
41
|
-
required: false
|
|
42
|
-
type: string
|
|
43
|
-
default: '.github/k6/scripts/default-test.js'
|
|
44
|
-
fail_on_threshold:
|
|
45
|
-
description: 'Fail workflow if thresholds are not met'
|
|
46
|
-
required: false
|
|
47
|
-
type: boolean
|
|
48
|
-
default: true
|
|
49
|
-
upload_results:
|
|
50
|
-
description: 'Upload test results as artifacts'
|
|
51
|
-
required: false
|
|
52
|
-
type: boolean
|
|
53
|
-
default: true
|
|
54
|
-
cloud_run:
|
|
55
|
-
description: 'Run tests on k6 Cloud (requires K6_CLOUD_TOKEN secret)'
|
|
56
|
-
required: false
|
|
57
|
-
type: boolean
|
|
58
|
-
default: false
|
|
59
|
-
outputs:
|
|
60
|
-
test_passed:
|
|
61
|
-
description: 'Whether the test passed all thresholds'
|
|
62
|
-
value: ${{ jobs.k6_test.outputs.passed }}
|
|
63
|
-
results_url:
|
|
64
|
-
description: 'URL to test results (if uploaded)'
|
|
65
|
-
value: ${{ jobs.k6_test.outputs.results_url }}
|
|
66
|
-
summary:
|
|
67
|
-
description: 'Test execution summary'
|
|
68
|
-
value: ${{ jobs.k6_test.outputs.summary }}
|
|
69
|
-
secrets:
|
|
70
|
-
K6_CLOUD_TOKEN:
|
|
71
|
-
required: false
|
|
72
|
-
description: 'k6 Cloud API token for cloud runs'
|
|
73
|
-
CUSTOM_HEADERS:
|
|
74
|
-
required: false
|
|
75
|
-
description: 'Custom headers for authenticated endpoints (JSON format)'
|
|
76
|
-
|
|
77
|
-
jobs:
|
|
78
|
-
k6_test:
|
|
79
|
-
name: K6 Load Test - ${{ inputs.test_scenario }}
|
|
80
|
-
runs-on: ubuntu-latest
|
|
81
|
-
outputs:
|
|
82
|
-
passed: ${{ steps.run_test.outputs.passed }}
|
|
83
|
-
results_url: ${{ steps.upload_results.outputs.artifact-url }}
|
|
84
|
-
summary: ${{ steps.generate_summary.outputs.summary }}
|
|
85
|
-
|
|
86
|
-
steps:
|
|
87
|
-
- name: Checkout repository
|
|
88
|
-
uses: actions/checkout@v4
|
|
89
|
-
|
|
90
|
-
- name: Set up k6
|
|
91
|
-
run: |
|
|
92
|
-
if [ "${{ inputs.k6_version }}" = "latest" ]; then
|
|
93
|
-
sudo gpg -k
|
|
94
|
-
sudo gpg --no-default-keyring \
|
|
95
|
-
--keyring /usr/share/keyrings/k6-archive-keyring.gpg \
|
|
96
|
-
--keyserver hkp://keyserver.ubuntu.com:80 \
|
|
97
|
-
--recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
|
|
98
|
-
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" \
|
|
99
|
-
| sudo tee /etc/apt/sources.list.d/k6.list
|
|
100
|
-
sudo apt-get update
|
|
101
|
-
sudo apt-get install k6
|
|
102
|
-
else
|
|
103
|
-
K6_VERSION="${{ inputs.k6_version }}"
|
|
104
|
-
wget "https://github.com/grafana/k6/releases/download/v${K6_VERSION}/k6-v${K6_VERSION}-linux-amd64.tar.gz"
|
|
105
|
-
tar -xzf "k6-v${K6_VERSION}-linux-amd64.tar.gz"
|
|
106
|
-
sudo mv "k6-v${K6_VERSION}-linux-amd64/k6" /usr/local/bin/
|
|
107
|
-
fi
|
|
108
|
-
k6 version
|
|
109
|
-
|
|
110
|
-
- name: Prepare test environment
|
|
111
|
-
id: prepare_test
|
|
112
|
-
run: |
|
|
113
|
-
# Create results directory
|
|
114
|
-
mkdir -p k6-results
|
|
115
|
-
|
|
116
|
-
# Export environment variables for k6
|
|
117
|
-
{
|
|
118
|
-
echo "K6_BASE_URL=${{ inputs.base_url }}"
|
|
119
|
-
echo "K6_SCENARIO=${{ inputs.test_scenario }}"
|
|
120
|
-
echo "K6_ENVIRONMENT=${{ inputs.environment }}"
|
|
121
|
-
} >> "$GITHUB_ENV"
|
|
122
|
-
|
|
123
|
-
# Set custom duration if provided
|
|
124
|
-
if [ -n "${{ inputs.test_duration }}" ]; then
|
|
125
|
-
echo "K6_DURATION=${{ inputs.test_duration }}" >> "$GITHUB_ENV"
|
|
126
|
-
fi
|
|
127
|
-
|
|
128
|
-
# Set custom VUs if provided
|
|
129
|
-
if [ -n "${{ inputs.virtual_users }}" ]; then
|
|
130
|
-
echo "K6_VUS=${{ inputs.virtual_users }}" >> "$GITHUB_ENV"
|
|
131
|
-
fi
|
|
132
|
-
|
|
133
|
-
# Set custom headers if provided
|
|
134
|
-
if [ -n "${{ secrets.CUSTOM_HEADERS }}" ]; then
|
|
135
|
-
echo "K6_CUSTOM_HEADERS=${{ secrets.CUSTOM_HEADERS }}" >> "$GITHUB_ENV"
|
|
136
|
-
fi
|
|
137
|
-
|
|
138
|
-
# Set cloud token if cloud run is enabled
|
|
139
|
-
if [ "${{ inputs.cloud_run }}" = "true" ] && [ -n "${{ secrets.K6_CLOUD_TOKEN }}" ]; then
|
|
140
|
-
echo "K6_CLOUD_TOKEN=${{ secrets.K6_CLOUD_TOKEN }}" >> "$GITHUB_ENV"
|
|
141
|
-
fi
|
|
142
|
-
|
|
143
|
-
- name: Run k6 test
|
|
144
|
-
id: run_test
|
|
145
|
-
run: |
|
|
146
|
-
set +e # Don't exit immediately on error
|
|
147
|
-
|
|
148
|
-
# Use the shared runner script if a scenario is specified, otherwise use custom script
|
|
149
|
-
if [ "${{ inputs.test_script }}" = ".github/k6/scripts/default-test.js" ]; then
|
|
150
|
-
# Use shared runner for standard scenarios
|
|
151
|
-
RUNNER_ARGS="--scenario ${{ inputs.test_scenario }} --url ${{ inputs.base_url }} --json --csv"
|
|
152
|
-
|
|
153
|
-
# Add cloud option if enabled
|
|
154
|
-
if [ "${{ inputs.cloud_run }}" = "true" ]; then
|
|
155
|
-
RUNNER_ARGS="$RUNNER_ARGS --cloud"
|
|
156
|
-
fi
|
|
157
|
-
|
|
158
|
-
# Add duration override if provided
|
|
159
|
-
if [ -n "${{ inputs.test_duration }}" ]; then
|
|
160
|
-
RUNNER_ARGS="$RUNNER_ARGS --duration ${{ inputs.test_duration }}"
|
|
161
|
-
fi
|
|
162
|
-
|
|
163
|
-
# Add VUs override if provided
|
|
164
|
-
if [ -n "${{ inputs.virtual_users }}" ]; then
|
|
165
|
-
RUNNER_ARGS="$RUNNER_ARGS --vus ${{ inputs.virtual_users }}"
|
|
166
|
-
fi
|
|
167
|
-
|
|
168
|
-
# Add no-thresholds flag if needed
|
|
169
|
-
if [ "${{ inputs.fail_on_threshold }}" != "true" ]; then
|
|
170
|
-
RUNNER_ARGS="$RUNNER_ARGS --no-thresholds"
|
|
171
|
-
fi
|
|
172
|
-
|
|
173
|
-
echo "Running shared k6 runner: ./scripts/k6-run.sh $RUNNER_ARGS"
|
|
174
|
-
./scripts/k6-run.sh $RUNNER_ARGS
|
|
175
|
-
TEST_EXIT_CODE=$?
|
|
176
|
-
else
|
|
177
|
-
# Use custom script directly with k6
|
|
178
|
-
TEST_SCRIPT="${{ inputs.test_script }}"
|
|
179
|
-
|
|
180
|
-
# Build k6 command
|
|
181
|
-
K6_CMD="k6 run"
|
|
182
|
-
|
|
183
|
-
# Add cloud option if enabled
|
|
184
|
-
if [ "${{ inputs.cloud_run }}" = "true" ]; then
|
|
185
|
-
K6_CMD="$K6_CMD --cloud"
|
|
186
|
-
fi
|
|
187
|
-
|
|
188
|
-
# Add output options for local runs
|
|
189
|
-
if [ "${{ inputs.cloud_run }}" != "true" ]; then
|
|
190
|
-
K6_CMD="$K6_CMD --out json=k6-results/results.json --out csv=k6-results/results.csv"
|
|
191
|
-
fi
|
|
192
|
-
|
|
193
|
-
# Add thresholds config if provided
|
|
194
|
-
if [ -n "${{ inputs.thresholds_config }}" ]; then
|
|
195
|
-
K6_CMD="$K6_CMD --config ${{ inputs.thresholds_config }}"
|
|
196
|
-
fi
|
|
197
|
-
|
|
198
|
-
# Add test script
|
|
199
|
-
K6_CMD="$K6_CMD $TEST_SCRIPT"
|
|
200
|
-
|
|
201
|
-
echo "Running k6 command: $K6_CMD"
|
|
202
|
-
$K6_CMD
|
|
203
|
-
TEST_EXIT_CODE=$?
|
|
204
|
-
fi
|
|
205
|
-
|
|
206
|
-
echo "exit_code=$TEST_EXIT_CODE" >> "$GITHUB_OUTPUT"
|
|
207
|
-
|
|
208
|
-
# Determine if test passed
|
|
209
|
-
if [ $TEST_EXIT_CODE -eq 0 ]; then
|
|
210
|
-
echo "passed=true" >> "$GITHUB_OUTPUT"
|
|
211
|
-
echo "✅ Test passed all thresholds" >> "$GITHUB_STEP_SUMMARY"
|
|
212
|
-
else
|
|
213
|
-
echo "passed=false" >> "$GITHUB_OUTPUT"
|
|
214
|
-
echo "❌ Test failed thresholds" >> "$GITHUB_STEP_SUMMARY"
|
|
215
|
-
fi
|
|
216
|
-
|
|
217
|
-
# Exit with appropriate code based on fail_on_threshold setting
|
|
218
|
-
if [ "${{ inputs.fail_on_threshold }}" = "true" ] && [ $TEST_EXIT_CODE -ne 0 ]; then
|
|
219
|
-
exit $TEST_EXIT_CODE
|
|
220
|
-
fi
|
|
221
|
-
|
|
222
|
-
- name: Generate test summary
|
|
223
|
-
id: generate_summary
|
|
224
|
-
if: always()
|
|
225
|
-
run: |
|
|
226
|
-
# Create summary content
|
|
227
|
-
SUMMARY="# K6 Load Test Results\n\n"
|
|
228
|
-
SUMMARY+="**Environment:** ${{ inputs.environment }}\n"
|
|
229
|
-
SUMMARY+="**Test Scenario:** ${{ inputs.test_scenario }}\n"
|
|
230
|
-
SUMMARY+="**Base URL:** ${{ inputs.base_url }}\n"
|
|
231
|
-
SUMMARY+="**Test Status:** "
|
|
232
|
-
|
|
233
|
-
if [ "${{ steps.run_test.outputs.passed }}" = "true" ]; then
|
|
234
|
-
SUMMARY+="✅ PASSED\n"
|
|
235
|
-
else
|
|
236
|
-
SUMMARY+="❌ FAILED\n"
|
|
237
|
-
fi
|
|
238
|
-
|
|
239
|
-
# Add summary to GitHub Step Summary
|
|
240
|
-
echo -e "$SUMMARY" >> "$GITHUB_STEP_SUMMARY"
|
|
241
|
-
|
|
242
|
-
# Extract key metrics from results if available
|
|
243
|
-
if [ -f "k6-results/results.json" ]; then
|
|
244
|
-
echo -e "\n## Key Metrics\n" >> "$GITHUB_STEP_SUMMARY"
|
|
245
|
-
|
|
246
|
-
# Parse JSON results for key metrics (simplified example)
|
|
247
|
-
# In a real implementation, you'd use jq or similar to extract detailed metrics
|
|
248
|
-
echo "📊 Detailed metrics available in artifacts" >> "$GITHUB_STEP_SUMMARY"
|
|
249
|
-
fi
|
|
250
|
-
|
|
251
|
-
# Output summary for workflow output
|
|
252
|
-
{
|
|
253
|
-
echo "summary<<EOF"
|
|
254
|
-
echo -e "$SUMMARY"
|
|
255
|
-
echo "EOF"
|
|
256
|
-
} >> "$GITHUB_OUTPUT"
|
|
257
|
-
|
|
258
|
-
- name: Upload test results
|
|
259
|
-
id: upload_results
|
|
260
|
-
if: always() && inputs.upload_results
|
|
261
|
-
uses: actions/upload-artifact@v4
|
|
262
|
-
with:
|
|
263
|
-
name: k6-results-${{ inputs.environment }}-${{ inputs.test_scenario }}-${{ github.run_id }}
|
|
264
|
-
path: k6-results/
|
|
265
|
-
retention-days: 30
|
|
266
|
-
|
|
267
|
-
- name: Comment on PR
|
|
268
|
-
if: github.event_name == 'pull_request' && always()
|
|
269
|
-
uses: actions/github-script@v7
|
|
270
|
-
with:
|
|
271
|
-
script: |
|
|
272
|
-
const summary = `${{ steps.generate_summary.outputs.summary }}`;
|
|
273
|
-
const resultsUrl = '${{ steps.upload_results.outputs.artifact-url }}';
|
|
274
|
-
|
|
275
|
-
let comment = summary;
|
|
276
|
-
if (resultsUrl) {
|
|
277
|
-
comment += `\n\n[📊 View detailed results](${resultsUrl})`;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
github.rest.issues.createComment({
|
|
281
|
-
issue_number: context.issue.number,
|
|
282
|
-
owner: context.repo.owner,
|
|
283
|
-
repo: context.repo.repo,
|
|
284
|
-
body: comment
|
|
285
|
-
});
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
|
|
4
|
-
name: ZAP Baseline Scan (NestJS)
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
workflow_call:
|
|
8
|
-
inputs:
|
|
9
|
-
node_version:
|
|
10
|
-
description: 'Node.js version to use'
|
|
11
|
-
required: false
|
|
12
|
-
default: '22.21.1'
|
|
13
|
-
type: string
|
|
14
|
-
package_manager:
|
|
15
|
-
description: 'Package manager to use (npm, yarn, or bun)'
|
|
16
|
-
required: false
|
|
17
|
-
default: 'bun'
|
|
18
|
-
type: string
|
|
19
|
-
zap_target_url:
|
|
20
|
-
description: 'Override URL for ZAP to scan (default: http://localhost:3000/graphql)'
|
|
21
|
-
required: false
|
|
22
|
-
default: 'http://localhost:3000/graphql'
|
|
23
|
-
type: string
|
|
24
|
-
zap_rules_file:
|
|
25
|
-
description: 'Path to ZAP rules configuration file'
|
|
26
|
-
required: false
|
|
27
|
-
default: '.zap/baseline.conf'
|
|
28
|
-
type: string
|
|
29
|
-
|
|
30
|
-
jobs:
|
|
31
|
-
zap_baseline:
|
|
32
|
-
name: ZAP Baseline Scan
|
|
33
|
-
runs-on: ubuntu-latest
|
|
34
|
-
timeout-minutes: 20
|
|
35
|
-
|
|
36
|
-
steps:
|
|
37
|
-
- name: Checkout repository
|
|
38
|
-
uses: actions/checkout@v4
|
|
39
|
-
|
|
40
|
-
- name: Setup Node.js
|
|
41
|
-
uses: actions/setup-node@v4
|
|
42
|
-
with:
|
|
43
|
-
node-version: ${{ inputs.node_version }}
|
|
44
|
-
cache: ${{ inputs.package_manager != 'bun' && inputs.package_manager || '' }}
|
|
45
|
-
|
|
46
|
-
- name: Setup Bun
|
|
47
|
-
if: inputs.package_manager == 'bun'
|
|
48
|
-
uses: oven-sh/setup-bun@v2
|
|
49
|
-
with:
|
|
50
|
-
bun-version: '1.3.8'
|
|
51
|
-
|
|
52
|
-
- name: Install dependencies
|
|
53
|
-
run: |
|
|
54
|
-
if [ "${{ inputs.package_manager }}" = "npm" ]; then
|
|
55
|
-
npm ci
|
|
56
|
-
elif [ "${{ inputs.package_manager }}" = "yarn" ]; then
|
|
57
|
-
yarn install --frozen-lockfile
|
|
58
|
-
elif [ "${{ inputs.package_manager }}" = "bun" ]; then
|
|
59
|
-
bun install --frozen-lockfile
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
- name: Build project
|
|
63
|
-
run: ${{ inputs.package_manager }} run build
|
|
64
|
-
|
|
65
|
-
- name: Start NestJS server
|
|
66
|
-
run: |
|
|
67
|
-
${{ inputs.package_manager }} run start &
|
|
68
|
-
SERVER_PID=$!
|
|
69
|
-
echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV
|
|
70
|
-
env:
|
|
71
|
-
NODE_ENV: test
|
|
72
|
-
PORT: 3000
|
|
73
|
-
|
|
74
|
-
- name: Wait for server ready
|
|
75
|
-
run: |
|
|
76
|
-
echo "Waiting for NestJS server to be ready..."
|
|
77
|
-
RETRIES=30
|
|
78
|
-
until curl -sf http://localhost:3000/health > /dev/null 2>&1 || [ $RETRIES -eq 0 ]; do
|
|
79
|
-
echo "Waiting for server... ($RETRIES retries left)"
|
|
80
|
-
RETRIES=$((RETRIES - 1))
|
|
81
|
-
sleep 2
|
|
82
|
-
done
|
|
83
|
-
if [ $RETRIES -eq 0 ]; then
|
|
84
|
-
echo "Server failed to start within timeout"
|
|
85
|
-
exit 1
|
|
86
|
-
fi
|
|
87
|
-
echo "Server is ready"
|
|
88
|
-
|
|
89
|
-
- name: Check for ZAP rules file
|
|
90
|
-
id: check_rules
|
|
91
|
-
run: |
|
|
92
|
-
if [ -f "${{ inputs.zap_rules_file }}" ]; then
|
|
93
|
-
echo "has_rules=true" >> $GITHUB_OUTPUT
|
|
94
|
-
else
|
|
95
|
-
echo "has_rules=false" >> $GITHUB_OUTPUT
|
|
96
|
-
fi
|
|
97
|
-
|
|
98
|
-
- name: Run ZAP baseline scan
|
|
99
|
-
uses: zaproxy/action-baseline@v0.14.0
|
|
100
|
-
with:
|
|
101
|
-
target: ${{ inputs.zap_target_url }}
|
|
102
|
-
rules_file_name: ${{ steps.check_rules.outputs.has_rules == 'true' && inputs.zap_rules_file || '' }}
|
|
103
|
-
fail_action: true
|
|
104
|
-
allow_issue_writing: false
|
|
105
|
-
artifact_name: 'zap-report-nestjs'
|
|
106
|
-
|
|
107
|
-
- name: Stop NestJS server
|
|
108
|
-
if: always()
|
|
109
|
-
run: |
|
|
110
|
-
if [ -n "$SERVER_PID" ]; then
|
|
111
|
-
kill "$SERVER_PID" 2>/dev/null || true
|
|
112
|
-
fi
|
|
113
|
-
|
|
114
|
-
- name: Upload ZAP report
|
|
115
|
-
if: always()
|
|
116
|
-
uses: actions/upload-artifact@v4
|
|
117
|
-
with:
|
|
118
|
-
name: zap-baseline-report-nestjs-${{ github.run_id }}
|
|
119
|
-
path: |
|
|
120
|
-
zap-report.html
|
|
121
|
-
zap-report.json
|
|
122
|
-
zap-report.md
|
|
123
|
-
retention-days: 14
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
|
|
4
|
-
name: Auto-update PR branches
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- main
|
|
10
|
-
- staging
|
|
11
|
-
- dev
|
|
12
|
-
pull_request:
|
|
13
|
-
types: [opened, reopened, ready_for_review]
|
|
14
|
-
|
|
15
|
-
permissions:
|
|
16
|
-
contents: write
|
|
17
|
-
pull-requests: write
|
|
18
|
-
|
|
19
|
-
jobs:
|
|
20
|
-
autoupdate-on-push:
|
|
21
|
-
name: Update open PRs targeting ${{ github.ref_name }}
|
|
22
|
-
if: github.event_name == 'push'
|
|
23
|
-
runs-on: ubuntu-latest
|
|
24
|
-
steps:
|
|
25
|
-
- name: Auto-update pull request branches
|
|
26
|
-
uses: chinthakagodawita/autoupdate@v1.7.0
|
|
27
|
-
continue-on-error: true
|
|
28
|
-
env:
|
|
29
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
30
|
-
PR_FILTER: 'all'
|
|
31
|
-
PR_READY_STATE: 'all'
|
|
32
|
-
MERGE_CONFLICT_ACTION: 'ignore'
|
|
33
|
-
RETRY_COUNT: '5'
|
|
34
|
-
RETRY_SLEEP: '300'
|
|
35
|
-
|
|
36
|
-
autoupdate-on-pr:
|
|
37
|
-
name: Update PR branch against ${{ github.event.pull_request.base.ref }}
|
|
38
|
-
if: github.event_name == 'pull_request'
|
|
39
|
-
runs-on: ubuntu-latest
|
|
40
|
-
steps:
|
|
41
|
-
- name: Update PR branch
|
|
42
|
-
continue-on-error: true
|
|
43
|
-
env:
|
|
44
|
-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
45
|
-
run: gh api -X PUT "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/update-branch" -f update_method=merge
|