Skip to content

Commit

Permalink
Escape job name
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilosevic committed Oct 25, 2024
1 parent 6f5e09d commit ded34d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ jobs:
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
# Github job context unfortunately doesn't contain job_id, this is the workaround how to fetch it using GH API
# Example : build-and-test (runner, 2)
# Example : build-and-test (runner, 1)
JOB_NAME="${{ github.job }} (${{ matrix.build.runs-on }}, ${{ matrix.test_group_id }})"
echo "Expected job name: $JOB_NAME"
JOB_ID=$(curl -s -H "Authorization: token ${{ github.token }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" | \
jq -r '.jobs[] | select(.name | contains("$JOB_NAME")) | .id')
JOB_ID=$(curl -s -H "Authorization: token $GH_TOKEN" \
"https://api.github.com/repos/tenstorrent/tt-forge-fe/actions/runs/11514644813/jobs" | \
jq -r '.jobs[] | select(.name | contains("'"${JOB_NAME}"'")) | .id ')
echo "Current job id: $JOB_ID"
echo "job-id=$JOB_ID" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit ded34d1

Please sign in to comment.