From dfc6c0259e00316eb4a86cbd58f94cfe464c5677 Mon Sep 17 00:00:00 2001 From: Vladimir Milosevic Date: Mon, 28 Oct 2024 13:16:58 +0000 Subject: [PATCH] Move job name to env --- .github/workflows/build-and-test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 52441b526..8e341365b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -65,17 +65,18 @@ jobs: - name: Set reusable strings id: strings shell: bash + env: + job-name: "${{ github.job }} (${{ matrix.build.runs-on }}, ${{ matrix.test_group_id }})" + run: | echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT" 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, 1) - JOB_NAME="${{ github.job }} (${{ matrix.build.runs-on }}, ${{ matrix.test_group_id }})" - echo "Expected job name: $JOB_NAME" + echo "Expected job name: ${{ env.job-name }}" 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 ') + jq -r '.jobs[] | select(.name | contains("${{ env.job-name }}")) | .id ') echo "Current job id: $JOB_ID" echo "job-id=$JOB_ID" >> "$GITHUB_OUTPUT"