From 9a4c2ed8a9be9b9644a6c6c172d3f48e28f27000 Mon Sep 17 00:00:00 2001 From: DeliciousBuding Date: Fri, 21 Aug 2026 22:35:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E6=81=92=E6=8A=A5=20fallback=20?= =?UTF-8?q?=E9=94=9A=E5=AE=9A=20repo=20root=EF=BC=8C=E4=BF=AE=E5=A4=8D=20c?= =?UTF-8?q?heckout=20=E8=B7=B3=E8=BF=87=E6=97=B6=20cwd=20=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .github/workflows/checks.yml | 8 ++++++++ scripts/verify/tests/verify-ci-gates.Tests.py | 4 ++++ 2 files changed, 12 insertions(+) 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"