diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 730d045d1..827c956a4 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -159,8 +159,11 @@ jobs: # Fallback: keep the required check reported even when the Go path # filter deselects this job (skipped jobs never satisfy branch # protection and permanently block frontend-only PRs). + # The job default cwd (edge-server) does not exist when checkout was + # deselected; anchor the fallback at the repo root. - name: Report no-Go-changes skip (required check) if: ${{ !cancelled() && github.event_name != 'workflow_dispatch' && needs.changes.result == 'success' && needs.changes.outputs.go != 'true' }} + working-directory: . run: | echo "skipped: no Go changes; reporting success for required check go-edge" exit 0 @@ -170,6 +173,7 @@ jobs: # the skipped real gates as green. - name: Fail when Go path filter failed if: ${{ !cancelled() && github.event_name != 'workflow_dispatch' && needs.changes.result != 'success' }} + working-directory: . run: | echo "::error::changes job result: ${{ needs.changes.result }}; cannot decide Go gates for go-edge" exit 1 @@ -348,8 +352,11 @@ jobs: # Fallback: keep the required check reported even when the Go path # filter deselects this job (skipped jobs never satisfy branch # protection and permanently block frontend-only PRs). + # The job default cwd (hub-server) does not exist when checkout was + # deselected; anchor the fallback at the repo root. - name: Report no-Go-changes skip (required check) if: ${{ !cancelled() && github.event_name != 'workflow_dispatch' && needs.changes.result == 'success' && needs.changes.outputs.go != 'true' }} + working-directory: . run: | echo "skipped: no Go changes; reporting success for required check go-hub" exit 0 @@ -359,6 +366,7 @@ jobs: # the skipped real gates as green. - name: Fail when Go path filter failed if: ${{ !cancelled() && github.event_name != 'workflow_dispatch' && needs.changes.result != 'success' }} + working-directory: . run: | echo "::error::changes job result: ${{ needs.changes.result }}; cannot decide Go gates for go-hub" exit 1 diff --git a/scripts/verify/tests/verify-ci-gates.Tests.py b/scripts/verify/tests/verify-ci-gates.Tests.py index c20a01ea8..9afa9cd8b 100644 --- a/scripts/verify/tests/verify-ci-gates.Tests.py +++ b/scripts/verify/tests/verify-ci-gates.Tests.py @@ -148,8 +148,11 @@ def restore_go_hub_job_path_filter(text: str) -> str: " # Fallback: keep the required check reported even when the Go path\n" " # filter deselects this job (skipped jobs never satisfy branch\n" " # protection and permanently block frontend-only PRs).\n" + " # The job default cwd (hub-server) does not exist when checkout was\n" + " # deselected; anchor the fallback at the repo root.\n" " - name: Report no-Go-changes skip (required check)\n" " if: ${{ !cancelled() && github.event_name != 'workflow_dispatch' && needs.changes.result == 'success' && needs.changes.outputs.go != 'true' }}\n" + " working-directory: .\n" " run: |\n" ' echo "skipped: no Go changes; reporting success for required check go-hub"\n' " exit 0\n" @@ -180,6 +183,7 @@ def remove_go_fallback_changes_success_guard(text: str) -> str: " # the skipped real gates as green.\n" " - name: Fail when Go path filter failed\n" " if: ${{ !cancelled() && github.event_name != 'workflow_dispatch' && needs.changes.result != 'success' }}\n" + " working-directory: .\n" " run: |\n" ' echo "::error::changes job result: ${{ needs.changes.result }}; cannot decide Go gates for go-hub"\n' " exit 1\n"