mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
Meta: Add discord notifications for pushes and pull requests
These are similar to the existing irc notifications.
This commit is contained in:
parent
2146d22432
commit
6c5bb9a18f
1 changed files with 28 additions and 0 deletions
28
.github/workflows/cmake.yml
vendored
28
.github/workflows/cmake.yml
vendored
|
@ -253,3 +253,31 @@ jobs:
|
||||||
${{ toJSON(github.event) }}
|
${{ toJSON(github.event) }}
|
||||||
]
|
]
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
notify_discord:
|
||||||
|
needs: [build_and_test_serenity, build_and_test_lagom]
|
||||||
|
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:
|
||||||
|
# Sets environment variable env.WORKFLOW_CONCLUSION to one of [neutral, success, skipped, cancelled, timed_out, action_required, failure]
|
||||||
|
# depending on result of all needs jobs
|
||||||
|
- uses: technote-space/workflow-conclusion-action@v2
|
||||||
|
|
||||||
|
# === NOTIFICATIONS ===
|
||||||
|
|
||||||
|
- name: Discord action notification
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
uses: Ilshidur/action-discord@0.3.0
|
||||||
|
if: ${{ (github.event['pull_request'] && github.event['action'] == 'opened' && !(github.event['pull_request'] == 'draft')) || github.event['commits'] }}
|
||||||
|
|
||||||
|
- name: Discord build result
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
DISCORD_USERNAME: GitHub # we have to set these manually for non-default messages
|
||||||
|
DISCORD_AVATAR: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
|
||||||
|
uses: Ilshidur/action-discord@0.3.0
|
||||||
|
if: ${{ (github.event['pull_request'] && github.event['action'] == 'opened' && !(github.event['pull_request'] == 'draft')) || github.event['commits'] }}
|
||||||
|
with:
|
||||||
|
args: "The build ${{ env.WORKFLOW_CONCLUSION == 'success' && 'passed :white_check_mark:' || 'failed :x:' }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue