File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44GITHUB_TOKEN=" $GITHUB_TOKEN " # Your GitHub Personal Access Token (from env)
55REPO=" $REPO " # Your repository name (from env)
66RUN_ID=" $RUN_ID " # The specific workflow run ID (from env)
7- JOB_ID=" $JOB_ID " # The *current* job's ID (from env)
7+ JOB_ID=" $JOB_ID " # The *current* job's name (from env)
88INTERVAL_SECONDS=10 # How often to check the status
99
1010# Function to get *overall* workflow run status
@@ -25,12 +25,14 @@ check_other_jobs_status() {
2525 non_completed_count=$( curl -s -H " Authorization: token $GITHUB_TOKEN " \
2626 -H " Accept: application/vnd.github.v3+json" \
2727 " https://api.github.com/repos/$REPO /actions/runs/$RUN_ID /jobs" | \
28- jq --argjson jid " $JOB_ID " '
28+ jq --arg jid " $JOB_ID " '
2929 .jobs | map(
3030 # Select jobs that are NOT the current job AND are NOT completed
31- select(.id != $jid and .status != "completed")
31+ select(.name != $jid and .status != "completed")
3232 ) | length
3333 ' )
34+
35+ # Note: I changed --argjson to --arg for string comparison
3436
3537 if [ -z " $non_completed_count " ]; then
3638 echo " Error: Could not parse job statuses. Check JOB_ID ($JOB_ID ) and API response."
You can’t perform that action at this time.
0 commit comments