Skip to content

Commit

Permalink
Update status embed workflow (#1321)
Browse files Browse the repository at this point in the history
Removes redundant and incorrect condition, and improves consistency with other repos
  • Loading branch information
wookie184 committed May 20, 2024
1 parent 350c2b7 commit a8cb9e4
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/status-embed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit a8cb9e4

Please sign in to comment.