Skip to content

Commit

Permalink
Print jobid
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilosevic committed Oct 14, 2024
1 parent 9e5a9e0 commit ae39c51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build and Test
on:
workflow_dispatch:
workflow_call:
push:

jobs:

Expand Down Expand Up @@ -44,7 +45,8 @@ jobs:
# Github job context unfortunately doesn't contain job_id, this is the workaround how to fetch it using GH API
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 | startswith("${{ github.job }}")) | .id')
jq -r '.jobs[] | select(.name | startswith("${{ github.job }}")) | .id')
echo "Current job id: $JOB_ID"
echo "job-id=$JOB_ID" >> "$GITHUB_OUTPUT"
echo "test_report_path=reports/report_$JOB_ID.xml" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit ae39c51

Please sign in to comment.