diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index 91b7937..9467d99 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -240,12 +240,16 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./job-context/ - id: job-context + id: job - name: Matches expected name run: '[[ "${output}" == "${expected}" ]] || exit 1' env: - output: ${{ steps.job-context.outputs.job-name }} + output: ${{ steps.job.outputs.name }} expected: "Job Name" + - name: Has Job ID + run: '[[ -n "${job_id}" ]] || exit 1' + env: + job_id: ${{ steps.job.outputs.id }} test-job-name-matrix: name: Job Name @@ -267,11 +271,11 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./job-context/ - id: job-context + id: job - name: Matches expected name run: '[[ "${output}" == "${expected}" ]] || exit 1' env: - output: ${{ steps.job-context.outputs.job-name }} + output: ${{ steps.job.outputs.name }} expected: "Job Name (${{ matrix.build.name }}, ${{ matrix.build.repo }}, ${{ matrix.version }})" - name: Matches GitHub API name run: | @@ -284,7 +288,7 @@ jobs: GH_TOKEN: ${{ github.token }} run_id: ${{ github.run_id }} run_attempt: ${{ github.run_attempt }} - job_name: ${{ steps.job-context.outputs.job-name }} + job_name: ${{ steps.job.outputs.name }} test-job-name-matrix-expr: # TODO: Using `github.job` with any expressions results in it being empty @@ -306,7 +310,7 @@ jobs: - name: Matches expected name run: '[[ "${output}" == "${expected}" ]] || exit 1' env: - output: ${{ steps.job-context.outputs.job-name }} + output: ${{ steps.job.outputs.name }} expected: ${{ github.event_name }} - - ${{ matrix.index }} - ${{ strategy.job-index }} - name: Matches GitHub API name run: | @@ -319,7 +323,7 @@ jobs: GH_TOKEN: ${{ github.token }} run_id: ${{ github.run_id }} run_attempt: ${{ github.run_attempt }} - job_name: ${{ steps.job-context.outputs.job-name }} + job_name: ${{ steps.job.outputs.name }} test-job-name-ambiguous: name: ${{ github.job }} @@ -336,16 +340,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./job-context/ - id: job-context - - name: Matches expected name - run: '[[ "${output}" == "${expected}" ]] || exit 1' - env: - output: ${{ steps.job-context.outputs.job-name }} - expected: ${{ github.job }} - - name: Matches multiple jobs - run: | - [[ $(jq length <<<"${job_ids}") -eq 2 ]] || exit 1 - [[ -z "${job_id}" ]] || exit 1 - env: - job_ids: ${{ steps.job-context.outputs.job-ids }} - job_id: ${{ steps.job-context.outputs.job-id }} + id: job + continue-on-error: true + - name: Action failed + if: ${{ steps.job.outcome != 'failure' }} + run: exit 1 \ No newline at end of file