Skip to content

Commit 7af2b36

Browse files
committed
fix(build): replace gh api with gh run list to avoid Windows path rewriting
- Replace 'gh api /repos/.../actions/runs' with 'gh run list --workflow=CI' - Resolves Windows Git Bash path rewriting issue where /repos/ gets converted to C:/Program Files/Git/repos/ - Uses GitHub CLI's high-level command instead of low-level API call - Improves cross-platform compatibility and code readability - Directly queries CI workflow status for specific commit SHA
1 parent 7f4d892 commit 7af2b36

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ jobs:
3838
run: |
3939
echo "Verifying CI workflow status for commit: $GITHUB_SHA"
4040
41-
# Get CI workflow status using GitHub API
42-
CI_STATUS=$(gh api \
43-
-H "Accept: application/vnd.github.v3+json" \
44-
"/repos/$GITHUB_REPOSITORY/actions/runs" \
45-
--jq ".workflow_runs[] | select(.head_sha == \"$GITHUB_SHA\" and .name == \"CI\") | .conclusion" \
41+
# Query CI workflow status for the specific commit using gh run list
42+
# This avoids Windows Git Bash path rewriting issues with gh api
43+
CI_STATUS=$(gh run list \
44+
--workflow="CI" \
45+
--json conclusion,headSha \
46+
--jq ".[] | select(.headSha == \"$GITHUB_SHA\") | .conclusion" \
4647
| head -1)
4748
4849
echo "CI workflow status: $CI_STATUS"

0 commit comments

Comments
 (0)