File tree 1 file changed +2
-2
lines changed 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 79
79
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
80
80
# List PRs associated with the commit, then get the PR number from the head ref or the latest PR.
81
81
associated_prs=$(gh api /repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha || github.sha }}/pulls --header "$GH_API" --method GET --field per_page=100)
82
- pr_number=$(echo "$associated_prs" | jq --raw-output '(.[] | select(.head.ref == ${{ github.ref_name }} ) | .number) // .[0].number // 0')
82
+ pr_number=$(echo "$associated_prs" | jq --raw-output '(.[] | select(.head.ref == env.GITHUB_REF_NAME ) | .number) // .[0].number // 0')
83
83
elif [[ "$GITHUB_EVENT_NAME" == "merge_group" ]]; then
84
84
# Get the PR number by parsing the ref name.
85
85
pr_number=$(echo "${{ github.ref_name }}" | sed -n 's/.*pr-\([0-9]*\)-.*/\1/p')
@@ -101,7 +101,7 @@ runs:
101
101
if [[ "$GH_MATRIX" == "null" ]]; then
102
102
# For regular jobs, get the ID of the job with the same name as job_id (lowercase and '-' or '_' replaced with ' ').
103
103
# Otherwise, get the ID of the first job in the list as a fallback.
104
- job_id=$(echo "$workflow_run" | jq --raw-output '(.jobs[] | select((.name | ascii_downcase | gsub("-|_"; " ")) == (${{ github.job }} | ascii_downcase | gsub("-|_"; " "))) | .id) // .jobs[0].id' | tail -n 1)
104
+ job_id=$(echo "$workflow_run" | jq --raw-output '(.jobs[] | select((.name | ascii_downcase | gsub("-|_"; " ")) == (env.GITHUB_JOB | ascii_downcase | gsub("-|_"; " "))) | .id) // .jobs[0].id' | tail -n 1)
105
105
else
106
106
# For matrix jobs, join the matrix values with comma separator into a single string and get the ID of the job which contains it.
107
107
matrix=$(echo "$GH_MATRIX" | jq --raw-output 'to_entries | map(.value) | join(", ")')
You can’t perform that action at this time.
0 commit comments