2022-02-06 04:40:42 +00:00
|
|
|
name: Discord notifications
|
2022-01-20 23:09:34 +00:00
|
|
|
|
|
|
|
on:
|
2023-12-06 04:07:15 +00:00
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
2022-01-20 23:09:34 +00:00
|
|
|
workflow_run:
|
2023-12-06 04:07:15 +00:00
|
|
|
workflows: ["Build and Publish"]
|
2022-01-20 23:09:34 +00:00
|
|
|
types:
|
|
|
|
- completed
|
|
|
|
|
|
|
|
env:
|
|
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
discord:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
2023-12-06 04:07:15 +00:00
|
|
|
- name: on-publish
|
|
|
|
if: github.event_name == 'release' && github.event.action == 'published'
|
2023-12-15 14:13:54 +00:00
|
|
|
uses: SethCohen/github-releases-to-discord@v1.15.0
|
2023-12-06 04:07:15 +00:00
|
|
|
with:
|
2023-12-07 16:04:06 +00:00
|
|
|
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
2022-01-20 23:09:34 +00:00
|
|
|
- name: on-success
|
2023-12-06 04:07:15 +00:00
|
|
|
if: github.event.workflow_run.conclusion == 'success'
|
2022-01-20 23:09:34 +00:00
|
|
|
uses: Ilshidur/action-discord@master
|
|
|
|
with:
|
2023-12-06 04:07:15 +00:00
|
|
|
args: |
|
|
|
|
Github repo: ${{ github.repository }}
|
|
|
|
- Branch: ${{ github.event.workflow_run.head_branch }}
|
|
|
|
- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)
|
|
|
|
- Status: 🎉 ${{ github.event.workflow_run.conclusion }} 🍏
|
2022-01-20 23:09:34 +00:00
|
|
|
- name: on-failure
|
2023-12-06 04:07:15 +00:00
|
|
|
if: github.event.workflow_run.conclusion == 'failure'
|
2022-01-20 23:09:34 +00:00
|
|
|
uses: Ilshidur/action-discord@master
|
|
|
|
with:
|
2023-12-06 04:07:15 +00:00
|
|
|
args: |
|
|
|
|
Github repo: ${{ github.repository }}
|
|
|
|
- Branch: ${{ github.event.workflow_run.head_branch }}
|
|
|
|
- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)
|
|
|
|
- Status: 🤔 ${{ github.event.workflow_run.conclusion }} 💣💥
|