Fix stage source check: run after checkout, not before
Dev — Build & local smoke test / build-smoke (pull_request) Successful in 1m29s
Dev — Build & local smoke test / build-smoke (pull_request) Successful in 1m29s
git log -1 fails with 'not a git repository' when the workspace hasn't been checked out yet. Move the Enforce dev-only source step to after the Checkout step.
This commit is contained in:
@@ -32,10 +32,16 @@ jobs:
|
|||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Enforce dev-only source
|
- name: Enforce dev-only source
|
||||||
# stage only accepts merges from dev. Any PR from another branch fails
|
# stage only accepts merges from dev. Any PR from another branch fails
|
||||||
# here before a single build step runs.
|
# here before a single build step runs.
|
||||||
# workflow_dispatch is exempt (allows manual redeploy of current stage).
|
# workflow_dispatch is exempt (allows manual redeploy of current stage).
|
||||||
|
# Must run AFTER checkout — git commands require a cloned workspace.
|
||||||
if: github.event_name != 'workflow_dispatch'
|
if: github.event_name != 'workflow_dispatch'
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -61,11 +67,6 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Detect change type
|
- name: Detect change type
|
||||||
id: changetype
|
id: changetype
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user