mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
7fa5f6be7d
While these look nice, they require the discord workflow to sit around and wait for the build-and-lint workflow to finish in order to get its status which means we waste an extra workflow runner that does nothing for each build-and-lint run.
16 lines
870 B
YAML
16 lines
870 B
YAML
name: Discord notifications
|
|
|
|
on: [push, pull_request_target]
|
|
|
|
jobs:
|
|
notify_discord:
|
|
runs-on: ubuntu-20.04
|
|
if: always() && github.repository == 'SerenityOS/serenity' && (github.event_name == 'pull_request_target' || (github.event_name == 'push' && github.ref == 'refs/heads/master'))
|
|
|
|
steps:
|
|
- name: Discord action notification
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
CUSTOM_GITHUB_EVENT_NAME: ${{ github.event_name == 'pull_request_target' && 'pull_request' || github.event_name }} # fake the event type as discord doesn't know how to parse the special pull_request_target context
|
|
uses: IdanHo/action-discord@754598254f288e6d8e9fca637832e3c163515ba8
|
|
if: ${{ (github.event['pull_request'] && github.event['action'] == 'opened' && !github.event.pull_request.draft) || github.event['commits'] }}
|