-
Notifications
You must be signed in to change notification settings - Fork 10
588 lines (535 loc) · 23.6 KB
/
dependency-review.yml
File metadata and controls
588 lines (535 loc) · 23.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
name: dependency-review
# Supply-chain guardrails for dependency-update PRs -- for BOTH Dependabot
# and maintainers.
#
# Inspects the changed files, then conditionally runs Socket Firewall (sfw)
# install smoke jobs for the affected manifests, picking the firewall edition
# per PR:
#
# - Trusted authors: any in-repo (non-fork) PR other than Dependabot's
# (i.e. someone with write access) -> Socket Firewall ENTERPRISE through
# the socket-firewall environment and its SOCKET_SFW_API_TOKEN secret
# (authenticated, full org-policy enforcement).
# - Everyone else: Dependabot and all fork PRs from external contributors ->
# Socket Firewall FREE (anonymous, no API token), which is safe in the
# unprivileged `pull_request` context.
#
# Only Enterprise jobs declare the socket-firewall environment. Free jobs do
# not touch that environment or its token.
#
# Each sfw smoke job collects an sfw-artifacts/ directory (provenance context
# + the firewall's console logs) and uploads it as a build artifact
# (if: always(), so the report survives even when sfw BLOCKS an install --
# which is exactly when you want to read it).
#
# Pattern adapted from SocketDev/socket-basics and SocketDev/socket-sdk-python.
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
concurrency:
group: dependency-review-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
inspect:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
python_deps_changed: ${{ steps.diff.outputs.python_deps_changed }}
fixture_npm_changed: ${{ steps.diff.outputs.fixture_npm_changed }}
fixture_pypi_changed: ${{ steps.diff.outputs.fixture_pypi_changed }}
dockerfile_changed: ${{ steps.diff.outputs.dockerfile_changed }}
workflow_or_action_changed: ${{ steps.diff.outputs.workflow_or_action_changed }}
sfw_mode: ${{ steps.mode.outputs.sfw_mode }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Inspect changed files
id: diff
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
CHANGED_FILES="$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")"
{
echo "## Changed files"
echo '```'
printf '%s\n' "$CHANGED_FILES"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
has_file() {
local pattern="$1"
if printf '%s\n' "$CHANGED_FILES" | grep -Eq "$pattern"; then
echo "true"
else
echo "false"
fi
}
{
echo "python_deps_changed=$(has_file '^(pyproject\.toml|uv\.lock)$')"
echo "fixture_npm_changed=$(has_file '^tests/e2e/fixtures/simple-npm/')"
echo "fixture_pypi_changed=$(has_file '^tests/e2e/fixtures/simple-pypi/')"
echo "dockerfile_changed=$(has_file '^Dockerfile$')"
echo "workflow_or_action_changed=$(has_file '^\.github/workflows/|^\.github/actions/|^\.github/dependabot\.yml$')"
} >> "$GITHUB_OUTPUT"
- name: Determine Socket Firewall mode
id: mode
# Trusted == any in-repo (non-fork) PR that isn't Dependabot's. Only
# accounts with write access can push a branch to this repo, so a
# non-fork PR already implies a trusted author -- the same boundary
# GitHub uses to decide whether secrets are exposed at all.
#
# NB: author_association is deliberately NOT used to require strict org
# membership. It only reflects PUBLIC org membership, so private members
# (the common case) show up as CONTRIBUTOR and would be misclassified.
# Reliable strict-membership detection would need a read:org token or
# public membership. This step references NO secret regardless -- it
# only decides which smoke job runs.
env:
IS_DEPENDABOT: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
IS_FORK: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
AUTHOR_ASSOC: ${{ github.event.pull_request.author_association }}
run: |
mode=firewall-free
if [ "$IS_DEPENDABOT" != "true" ] && [ "$IS_FORK" != "true" ]; then
mode=firewall-enterprise
fi
echo "sfw_mode=$mode" >> "$GITHUB_OUTPUT"
{
echo "## Socket Firewall mode: \`$mode\`"
echo "- author_association: \`$AUTHOR_ASSOC\`"
echo "- dependabot: \`$IS_DEPENDABOT\` | fork: \`$IS_FORK\`"
} >> "$GITHUB_STEP_SUMMARY"
- name: Summarize review expectations
env:
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
{
echo "## Dependency Review Checklist"
echo "- PR: $PR_URL"
echo "- Confirm upstream release notes before merge"
echo "- Do not treat a dependency PR as trusted solely because of the actor"
echo "- This workflow runs in pull_request context only; no publish secrets are exposed"
} >> "$GITHUB_STEP_SUMMARY"
python-sfw-smoke-free:
needs: inspect
if: |
needs.inspect.outputs.python_deps_changed == 'true' &&
needs.inspect.outputs.sfw_mode == 'firewall-free'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Prepare SFW artifact directory
run: |
mkdir -p sfw-artifacts
{
echo "mode=firewall-free"
echo "manifest=python"
echo "pr=${{ github.event.pull_request.number }}"
echo "sha=${{ github.event.pull_request.head.sha }}"
} > sfw-artifacts/context.txt
- uses: ./.github/actions/setup-sfw
with:
uv: "true"
mode: firewall-free
- name: Sync project through Socket Firewall
# `sfw uv sync` is the intended way to route uv through Socket Firewall
# (per Socket's own uv wrapper guidance). --locked verifies the exact
# uv.lock set and fails on lockfile drift rather than silently
# re-resolving, so the firewall inspects precisely what would install.
# Note: uv's sfw integration is quieter than npm/pip -- it does not
# print the "N packages fetched" footer, but interception is active.
#
# Use the runner's setup-python interpreter and forbid managed-Python
# downloads. The firewall is here to vet PyPI installs, not the
# interpreter/toolchain download path.
#
# pipefail keeps sfw's exit code through the tee so a firewall block
# still fails the job; tee captures the report for the artifact upload.
env:
UV_PYTHON: "3.12"
UV_PYTHON_DOWNLOADS: never
run: |
set -o pipefail
sfw uv sync --locked --extra test --extra dev 2>&1 | tee sfw-artifacts/sfw-uv-sync.log
- name: Import smoke test
env:
UV_PYTHON: "3.12"
UV_PYTHON_DOWNLOADS: never
run: |
set -o pipefail
uv run python -c "
from socketsecurity.socketcli import cli, build_socket_sdk
from socketsecurity.core import Core
from socketsecurity.core.exceptions import (
APIFailure, RequestTimeoutExceeded, APIResourceNotFound,
)
from socketsecurity.core.git_interface import Git
from socketsecurity.config import CliConfig
print('import smoke OK')
" 2>&1 | tee sfw-artifacts/import-smoke.log
- name: Collect SFW JSON report
# socketdev/action points sfw at SFW_JSON_REPORT_PATH (a $RUNNER_TEMP
# file) and reads it back in its post step to render the job summary, so
# COPY (don't move) the report into the bundle. sfw writes it even when
# it blocks an install -- always() keeps it on failures too.
if: always()
run: |
if [ -n "${SFW_JSON_REPORT_PATH:-}" ] && [ -f "$SFW_JSON_REPORT_PATH" ]; then
cp "$SFW_JSON_REPORT_PATH" "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report.json"
echo "Collected SFW report -> sfw-artifacts/sfw-report.json"
else
echo "No SFW JSON report found at '${SFW_JSON_REPORT_PATH:-<unset>}'." \
> "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report-missing.txt"
fi
- name: Upload SFW report artifact
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: socket-firewall-free-python-${{ github.event.pull_request.number }}
path: sfw-artifacts/
if-no-files-found: warn
retention-days: 14
python-sfw-smoke-enterprise:
needs: inspect
if: |
needs.inspect.outputs.python_deps_changed == 'true' &&
needs.inspect.outputs.sfw_mode == 'firewall-enterprise'
runs-on: ubuntu-latest
timeout-minutes: 15
environment: socket-firewall
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Prepare SFW artifact directory
run: |
mkdir -p sfw-artifacts
{
echo "mode=firewall-enterprise"
echo "manifest=python"
echo "pr=${{ github.event.pull_request.number }}"
echo "sha=${{ github.event.pull_request.head.sha }}"
} > sfw-artifacts/context.txt
- uses: ./.github/actions/setup-sfw
with:
uv: "true"
mode: firewall-enterprise
socket-token: ${{ secrets.SOCKET_SFW_API_TOKEN }}
- name: Sync project through Socket Firewall
# `sfw uv sync` is the intended way to route uv through Socket Firewall
# (per Socket's own uv wrapper guidance). --locked verifies the exact
# uv.lock set and fails on lockfile drift rather than silently
# re-resolving, so the firewall inspects precisely what would install.
# Note: uv's sfw integration is quieter than npm/pip -- it does not
# print the "N packages fetched" footer, but interception is active.
#
# Use the runner's setup-python interpreter and forbid managed-Python
# downloads. The firewall is here to vet PyPI installs, not the
# interpreter/toolchain download path.
#
# pipefail keeps sfw's exit code through the tee so a firewall block
# still fails the job; tee captures the report for the artifact upload.
env:
UV_PYTHON: "3.12"
UV_PYTHON_DOWNLOADS: never
run: |
set -o pipefail
sfw uv sync --locked --extra test --extra dev 2>&1 | tee sfw-artifacts/sfw-uv-sync.log
- name: Import smoke test
env:
UV_PYTHON: "3.12"
UV_PYTHON_DOWNLOADS: never
run: |
set -o pipefail
uv run python -c "
from socketsecurity.socketcli import cli, build_socket_sdk
from socketsecurity.core import Core
from socketsecurity.core.exceptions import (
APIFailure, RequestTimeoutExceeded, APIResourceNotFound,
)
from socketsecurity.core.git_interface import Git
from socketsecurity.config import CliConfig
print('import smoke OK')
" 2>&1 | tee sfw-artifacts/import-smoke.log
- name: Collect SFW JSON report
# socketdev/action points sfw at SFW_JSON_REPORT_PATH (a $RUNNER_TEMP
# file) and reads it back in its post step to render the job summary, so
# COPY (don't move) the report into the bundle. sfw writes it even when
# it blocks an install -- always() keeps it on failures too.
if: always()
run: |
if [ -n "${SFW_JSON_REPORT_PATH:-}" ] && [ -f "$SFW_JSON_REPORT_PATH" ]; then
cp "$SFW_JSON_REPORT_PATH" "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report.json"
echo "Collected SFW report -> sfw-artifacts/sfw-report.json"
else
echo "No SFW JSON report found at '${SFW_JSON_REPORT_PATH:-<unset>}'." \
> "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report-missing.txt"
fi
- name: Upload SFW report artifact
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: socket-firewall-enterprise-python-${{ github.event.pull_request.number }}
path: sfw-artifacts/
if-no-files-found: warn
retention-days: 14
fixture-npm-sfw-smoke-free:
needs: inspect
if: |
needs.inspect.outputs.fixture_npm_changed == 'true' &&
needs.inspect.outputs.sfw_mode == 'firewall-free'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Prepare SFW artifact directory
run: |
mkdir -p sfw-artifacts
{
echo "mode=firewall-free"
echo "manifest=npm"
echo "pr=${{ github.event.pull_request.number }}"
echo "sha=${{ github.event.pull_request.head.sha }}"
} > sfw-artifacts/context.txt
- uses: ./.github/actions/setup-sfw
with:
node: "true"
mode: firewall-free
- name: Install fixture through Socket Firewall
working-directory: tests/e2e/fixtures/simple-npm
# Tee to an absolute path under the workspace so the log lands in the
# repo-root sfw-artifacts/ dir despite this step's working-directory.
run: |
set -o pipefail
sfw npm install --no-audit --no-fund --ignore-scripts 2>&1 | tee "$GITHUB_WORKSPACE/sfw-artifacts/sfw-npm-install.log"
- name: Collect SFW JSON report
# socketdev/action points sfw at SFW_JSON_REPORT_PATH (a $RUNNER_TEMP
# file) and reads it back in its post step to render the job summary, so
# COPY (don't move) the report into the bundle. sfw writes it even when
# it blocks an install -- always() keeps it on failures too.
if: always()
run: |
if [ -n "${SFW_JSON_REPORT_PATH:-}" ] && [ -f "$SFW_JSON_REPORT_PATH" ]; then
cp "$SFW_JSON_REPORT_PATH" "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report.json"
echo "Collected SFW report -> sfw-artifacts/sfw-report.json"
else
echo "No SFW JSON report found at '${SFW_JSON_REPORT_PATH:-<unset>}'." \
> "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report-missing.txt"
fi
- name: Upload SFW report artifact
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: socket-firewall-free-npm-${{ github.event.pull_request.number }}
path: sfw-artifacts/
if-no-files-found: warn
retention-days: 14
fixture-npm-sfw-smoke-enterprise:
needs: inspect
if: |
needs.inspect.outputs.fixture_npm_changed == 'true' &&
needs.inspect.outputs.sfw_mode == 'firewall-enterprise'
runs-on: ubuntu-latest
timeout-minutes: 15
environment: socket-firewall
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Prepare SFW artifact directory
run: |
mkdir -p sfw-artifacts
{
echo "mode=firewall-enterprise"
echo "manifest=npm"
echo "pr=${{ github.event.pull_request.number }}"
echo "sha=${{ github.event.pull_request.head.sha }}"
} > sfw-artifacts/context.txt
- uses: ./.github/actions/setup-sfw
with:
node: "true"
mode: firewall-enterprise
socket-token: ${{ secrets.SOCKET_SFW_API_TOKEN }}
- name: Install fixture through Socket Firewall
working-directory: tests/e2e/fixtures/simple-npm
# Tee to an absolute path under the workspace so the log lands in the
# repo-root sfw-artifacts/ dir despite this step's working-directory.
run: |
set -o pipefail
sfw npm install --no-audit --no-fund --ignore-scripts 2>&1 | tee "$GITHUB_WORKSPACE/sfw-artifacts/sfw-npm-install.log"
- name: Collect SFW JSON report
# socketdev/action points sfw at SFW_JSON_REPORT_PATH (a $RUNNER_TEMP
# file) and reads it back in its post step to render the job summary, so
# COPY (don't move) the report into the bundle. sfw writes it even when
# it blocks an install -- always() keeps it on failures too.
if: always()
run: |
if [ -n "${SFW_JSON_REPORT_PATH:-}" ] && [ -f "$SFW_JSON_REPORT_PATH" ]; then
cp "$SFW_JSON_REPORT_PATH" "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report.json"
echo "Collected SFW report -> sfw-artifacts/sfw-report.json"
else
echo "No SFW JSON report found at '${SFW_JSON_REPORT_PATH:-<unset>}'." \
> "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report-missing.txt"
fi
- name: Upload SFW report artifact
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: socket-firewall-enterprise-npm-${{ github.event.pull_request.number }}
path: sfw-artifacts/
if-no-files-found: warn
retention-days: 14
fixture-pypi-sfw-smoke-free:
needs: inspect
if: |
needs.inspect.outputs.fixture_pypi_changed == 'true' &&
needs.inspect.outputs.sfw_mode == 'firewall-free'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Prepare SFW artifact directory
run: |
mkdir -p sfw-artifacts
{
echo "mode=firewall-free"
echo "manifest=pypi"
echo "pr=${{ github.event.pull_request.number }}"
echo "sha=${{ github.event.pull_request.head.sha }}"
} > sfw-artifacts/context.txt
- uses: ./.github/actions/setup-sfw
with:
python: "true"
mode: firewall-free
- name: Install fixture through Socket Firewall
working-directory: tests/e2e/fixtures/simple-pypi
# Tee to an absolute path under the workspace so the log lands in the
# repo-root sfw-artifacts/ dir despite this step's working-directory.
run: |
set -o pipefail
python -m venv .venv
# shellcheck disable=SC1091
source .venv/bin/activate
sfw pip install -r requirements.txt 2>&1 | tee "$GITHUB_WORKSPACE/sfw-artifacts/sfw-pip-install.log"
- name: Collect SFW JSON report
# socketdev/action points sfw at SFW_JSON_REPORT_PATH (a $RUNNER_TEMP
# file) and reads it back in its post step to render the job summary, so
# COPY (don't move) the report into the bundle. sfw writes it even when
# it blocks an install -- always() keeps it on failures too.
if: always()
run: |
if [ -n "${SFW_JSON_REPORT_PATH:-}" ] && [ -f "$SFW_JSON_REPORT_PATH" ]; then
cp "$SFW_JSON_REPORT_PATH" "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report.json"
echo "Collected SFW report -> sfw-artifacts/sfw-report.json"
else
echo "No SFW JSON report found at '${SFW_JSON_REPORT_PATH:-<unset>}'." \
> "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report-missing.txt"
fi
- name: Upload SFW report artifact
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: socket-firewall-free-pypi-${{ github.event.pull_request.number }}
path: sfw-artifacts/
if-no-files-found: warn
retention-days: 14
fixture-pypi-sfw-smoke-enterprise:
needs: inspect
if: |
needs.inspect.outputs.fixture_pypi_changed == 'true' &&
needs.inspect.outputs.sfw_mode == 'firewall-enterprise'
runs-on: ubuntu-latest
timeout-minutes: 15
environment: socket-firewall
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Prepare SFW artifact directory
run: |
mkdir -p sfw-artifacts
{
echo "mode=firewall-enterprise"
echo "manifest=pypi"
echo "pr=${{ github.event.pull_request.number }}"
echo "sha=${{ github.event.pull_request.head.sha }}"
} > sfw-artifacts/context.txt
- uses: ./.github/actions/setup-sfw
with:
python: "true"
mode: firewall-enterprise
socket-token: ${{ secrets.SOCKET_SFW_API_TOKEN }}
- name: Install fixture through Socket Firewall
working-directory: tests/e2e/fixtures/simple-pypi
# Tee to an absolute path under the workspace so the log lands in the
# repo-root sfw-artifacts/ dir despite this step's working-directory.
run: |
set -o pipefail
python -m venv .venv
# shellcheck disable=SC1091
source .venv/bin/activate
sfw pip install -r requirements.txt 2>&1 | tee "$GITHUB_WORKSPACE/sfw-artifacts/sfw-pip-install.log"
- name: Collect SFW JSON report
# socketdev/action points sfw at SFW_JSON_REPORT_PATH (a $RUNNER_TEMP
# file) and reads it back in its post step to render the job summary, so
# COPY (don't move) the report into the bundle. sfw writes it even when
# it blocks an install -- always() keeps it on failures too.
if: always()
run: |
if [ -n "${SFW_JSON_REPORT_PATH:-}" ] && [ -f "$SFW_JSON_REPORT_PATH" ]; then
cp "$SFW_JSON_REPORT_PATH" "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report.json"
echo "Collected SFW report -> sfw-artifacts/sfw-report.json"
else
echo "No SFW JSON report found at '${SFW_JSON_REPORT_PATH:-<unset>}'." \
> "$GITHUB_WORKSPACE/sfw-artifacts/sfw-report-missing.txt"
fi
- name: Upload SFW report artifact
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: socket-firewall-enterprise-pypi-${{ github.event.pull_request.number }}
path: sfw-artifacts/
if-no-files-found: warn
retention-days: 14
dockerfile-smoke:
needs: inspect
if: needs.inspect.outputs.dockerfile_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Build the Dockerfile (no push)
run: docker build --pull -t socket-python-cli:dependabot-smoke .
workflow-notice:
needs: inspect
if: needs.inspect.outputs.workflow_or_action_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Flag workflow-sensitive updates
run: |
{
echo "## Sensitive File Notice"
echo "This PR changes workflow, composite-action, or dependabot config files."
echo "Require explicit human review before merge."
} >> "$GITHUB_STEP_SUMMARY"