Skip to content

Commit ae6ef36

Browse files
committed
#2465: Try extracting job number from matrix's job
1 parent a9ca8fc commit ae6ef36

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/build-docker-images.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ jobs:
8484
env:
8585
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
8686

87+
- name: Test
88+
run: |
89+
job_id=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id}}/attempts/${{ github.run_attempt }}/jobs | jq -r '.jobs | .[0].id')
90+
matrix_job_html_url=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id}}/attempts/${{ github.run_attempt }}/jobs | jq -r '.jobs | map(select(.name | contains("${{ matrix.region }}"))) | .[0].html_url')
91+
matrix_id=$( sed 's/.*\jobs\///' <<<$matrix_job_html_url)
92+
echo "matrix job html url: $matrix_job_html_url"
93+
echo "matrix id: $matrix_id" # i doubt this is of any use. in the github response this id is only present as part of the html_url
94+
echo "job id: $job_id"
95+
env:
96+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
8798
- name: Retrieve build artifacts
8899
run: |
89100
# We rely on the persistence of data on cache mounts with identical IDs and builders.

0 commit comments

Comments
 (0)