fix(ci): plumb VERCEL_AUTOMATION_BYPASS_SECRET into preview-smoke + visual-diff #17
2 changed files with 18 additions and 4 deletions
13
.github/workflows/preview-smoke.yml
vendored
13
.github/workflows/preview-smoke.yml
vendored
|
|
@ -40,11 +40,20 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Decide
|
- name: Decide
|
||||||
id: check
|
id: check
|
||||||
|
env:
|
||||||
|
# Route PR body + fork flag through env vars instead of inline
|
||||||
|
# ${{ }} interpolation. Direct ${{ github.event.pull_request.body }}
|
||||||
|
# in a shell command pastes arbitrary user-controlled text (parens,
|
||||||
|
# backticks, pipes, heredocs) directly into the script — both a
|
||||||
|
# syntax-error risk AND a shell-injection vector. Quoting the env
|
||||||
|
# vars below makes both safe.
|
||||||
|
PR_BODY: ${{ github.event.pull_request.body }}
|
||||||
|
PR_IS_FORK: ${{ github.event.pull_request.head.repo.fork }}
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then
|
if [[ "$PR_IS_FORK" == "true" ]]; then
|
||||||
echo "should_run=false" >> $GITHUB_OUTPUT
|
echo "should_run=false" >> $GITHUB_OUTPUT
|
||||||
echo "::notice::Smoke skipped on fork PR (bypass secret unavailable to forks)"
|
echo "::notice::Smoke skipped on fork PR (bypass secret unavailable to forks)"
|
||||||
elif echo "${{ github.event.pull_request.body }}" | grep -qE 'pipeline:.*skip.*\bsmoke\b'; then
|
elif echo "$PR_BODY" | grep -qE 'pipeline:.*skip.*\bsmoke\b'; then
|
||||||
echo "should_run=false" >> $GITHUB_OUTPUT
|
echo "should_run=false" >> $GITHUB_OUTPUT
|
||||||
echo "::notice::Smoke skipped via pipeline directive"
|
echo "::notice::Smoke skipped via pipeline directive"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
9
.github/workflows/visual-diff.yml
vendored
9
.github/workflows/visual-diff.yml
vendored
|
|
@ -36,11 +36,16 @@ jobs:
|
||||||
should_run: ${{ steps.check.outputs.should_run }}
|
should_run: ${{ steps.check.outputs.should_run }}
|
||||||
steps:
|
steps:
|
||||||
- id: check
|
- id: check
|
||||||
|
env:
|
||||||
|
# See preview-smoke.yml for the rationale: ${{ github.event.* }}
|
||||||
|
# inlined into shell is a syntax-error + injection vector.
|
||||||
|
PR_BODY: ${{ github.event.pull_request.body }}
|
||||||
|
PR_IS_FORK: ${{ github.event.pull_request.head.repo.fork }}
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then
|
if [[ "$PR_IS_FORK" == "true" ]]; then
|
||||||
echo "should_run=false" >> $GITHUB_OUTPUT
|
echo "should_run=false" >> $GITHUB_OUTPUT
|
||||||
echo "::notice::Visual diff skipped on fork PR (bypass secret unavailable to forks)"
|
echo "::notice::Visual diff skipped on fork PR (bypass secret unavailable to forks)"
|
||||||
elif echo "${{ github.event.pull_request.body }}" | grep -qE 'pipeline:.*skip.*\bvisual\b'; then
|
elif echo "$PR_BODY" | grep -qE 'pipeline:.*skip.*\bvisual\b'; then
|
||||||
echo "should_run=false" >> $GITHUB_OUTPUT
|
echo "should_run=false" >> $GITHUB_OUTPUT
|
||||||
echo "::notice::Visual diff skipped via pipeline directive"
|
echo "::notice::Visual diff skipped via pipeline directive"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue