From 345f9be81a5bffe4d4e5d07a3927a1c9a0fef576 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Sat, 9 May 2026 18:37:55 -0500 Subject: [PATCH] Fix stage source check: run after checkout, not before 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. --- .gitea/workflows/stage.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/stage.yaml b/.gitea/workflows/stage.yaml index bd6f3f4..e470d9e 100644 --- a/.gitea/workflows/stage.yaml +++ b/.gitea/workflows/stage.yaml @@ -32,10 +32,16 @@ jobs: id-token: write steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Enforce dev-only source # stage only accepts merges from dev. Any PR from another branch fails # here before a single build step runs. # 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' run: | set -euo pipefail @@ -61,11 +67,6 @@ jobs: exit 1 fi - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - name: Detect change type id: changetype run: | -- 2.52.0