From a8cb9e4b1d3deab2f135f35ab592e9cc4e54a686 Mon Sep 17 00:00:00 2001 From: wookie184 Date: Mon, 20 May 2024 16:09:59 +0100 Subject: [PATCH] Update status embed workflow (#1321) Removes redundant and incorrect condition, and improves consistency with other repos --- .github/workflows/status-embed.yaml | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/status-embed.yaml b/.github/workflows/status-embed.yaml index 5982b94b3..f90b211b3 100644 --- a/.github/workflows/status-embed.yaml +++ b/.github/workflows/status-embed.yaml @@ -7,24 +7,12 @@ on: types: - completed +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: status_embed: - # We need to send a status embed whenever the workflow - # sequence we're running terminates. There are a number - # of situations in which that happens: - # - # 1. We reach the end of the Deploy workflow, without - # it being skipped. - # - # 2. A `pull_request` triggered a Lint & Test workflow, - # as the sequence always terminates with one run. - # - # 3. If any workflow ends in failure or was cancelled. - if: >- - (github.event.workflow_run.name == 'Deploy' && github.event.workflow_run.conclusion != 'skipped') || - github.event.workflow_run.event == 'pull_request' || - github.event.workflow_run.conclusion == 'failure' || - github.event.workflow_run.conclusion == 'cancelled' name: Send Status Embed to Discord runs-on: ubuntu-latest @@ -60,14 +48,12 @@ jobs: webhook_id: '784184528997842985' webhook_token: ${{ secrets.GHA_WEBHOOK_TOKEN }} - # Workflow information + # We need to provide the information of the workflow that + # triggered this workflow instead of this workflow. workflow_name: ${{ github.event.workflow_run.name }} run_id: ${{ github.event.workflow_run.id }} run_number: ${{ github.event.workflow_run.run_number }} status: ${{ github.event.workflow_run.conclusion }} - actor: ${{ github.actor }} - repository: ${{ github.repository }} - ref: ${{ github.ref }} sha: ${{ github.event.workflow_run.head_sha }} pr_author_login: ${{ steps.pr_info.outputs.pr_author_login }}