Skip to content

Commit a8cb9e4

Browse files
authored
Update status embed workflow (#1321)
Removes redundant and incorrect condition, and improves consistency with other repos
1 parent 350c2b7 commit a8cb9e4

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

.github/workflows/status-embed.yaml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,12 @@ on:
77
types:
88
- completed
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
status_embed:
12-
# We need to send a status embed whenever the workflow
13-
# sequence we're running terminates. There are a number
14-
# of situations in which that happens:
15-
#
16-
# 1. We reach the end of the Deploy workflow, without
17-
# it being skipped.
18-
#
19-
# 2. A `pull_request` triggered a Lint & Test workflow,
20-
# as the sequence always terminates with one run.
21-
#
22-
# 3. If any workflow ends in failure or was cancelled.
23-
if: >-
24-
(github.event.workflow_run.name == 'Deploy' && github.event.workflow_run.conclusion != 'skipped') ||
25-
github.event.workflow_run.event == 'pull_request' ||
26-
github.event.workflow_run.conclusion == 'failure' ||
27-
github.event.workflow_run.conclusion == 'cancelled'
2816
name: Send Status Embed to Discord
2917
runs-on: ubuntu-latest
3018

@@ -60,14 +48,12 @@ jobs:
6048
webhook_id: '784184528997842985'
6149
webhook_token: ${{ secrets.GHA_WEBHOOK_TOKEN }}
6250

63-
# Workflow information
51+
# We need to provide the information of the workflow that
52+
# triggered this workflow instead of this workflow.
6453
workflow_name: ${{ github.event.workflow_run.name }}
6554
run_id: ${{ github.event.workflow_run.id }}
6655
run_number: ${{ github.event.workflow_run.run_number }}
6756
status: ${{ github.event.workflow_run.conclusion }}
68-
actor: ${{ github.actor }}
69-
repository: ${{ github.repository }}
70-
ref: ${{ github.ref }}
7157
sha: ${{ github.event.workflow_run.head_sha }}
7258

7359
pr_author_login: ${{ steps.pr_info.outputs.pr_author_login }}

0 commit comments

Comments
 (0)