Skip to content

Notify

Notify #44

Workflow file for this run

name: "Discord Notification"
on:
pull_request:
types: [ opened ]
issues:
types: [ opened ]
workflow_run:
workflows: ["Build Artifact", "build"]
types: [completed]
branches: ["*"]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: CI Build Success Notification
uses: sarisia/actions-status-discord@v1
with:
nodetail: true
title: "[${{ github.repository }}] ${{ github.actor }} pushed to `${{ github.ref }}`"
description: |
**Commits**:
● ${{ join(github.event.commits.*.message, '
● ') }}
---
**Link**: ${{ github.event.compare }}
color: 0x0000ff
username: ${{ github.actor }} on CFB
avatar_url: https://i.imgur.com/O4RKNqj.png
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: CI Build Failure Notification
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: sarisia/actions-status-discord@v1
with:
nodetail: true
title: "[${{ github.repository }}] ${{ github.actor }} pushed to `${{ github.ref }}`"
description: |
**Commits**:
● ${{ join(github.event.commits.*.message, '
● ') }}
---
**Link**: ${{ github.event.compare }}
color: 0xff0000
username: ${{ github.actor }} on CFB
avatar_url: https://i.imgur.com/O4RKNqj.png
on-pull-requests:
runs-on: ubuntu-latest
steps:
- name: Triggering Pull Request Discord Notification
if: github.event_name == 'pull_request' && github.event.action == 'opened' && github.repository_owner == 'hugsy'
uses: sarisia/actions-status-discord@v1
with:
nodetail: true
title: ${{ github.actor }} created a new Pull Request (`#${{ github.event.pull_request.number }}`)
description: |
**${{ github.event.pull_request.title }}**
${{ github.event.pull_request.body }}
---
Link: ${{ github.event.pull_request.html_url }}
color: 0xff0000
username: ${{ github.actor }} on CFB
avatar_url: https://i.imgur.com/O4RKNqj.png
on-issues:
runs-on: ubuntu-latest
steps:
- name: Triggering Issue Discord Notification
if: github.event_name == 'issues' && github.event.action == 'opened' && github.repository_owner == 'hugsy'
uses: sarisia/actions-status-discord@v1
with:
nodetail: true
title: ${{ github.actor }} created a new Issue (`#${{ github.event.issue.number }}`)
description: |
**${{ github.event.issue.title }}**
${{ github.event.issue.body }}
---
Link: ${{ github.event.issue.html_url }}
color: 0x00ff00
username: ${{ github.actor }} on CFB
avatar_url: https://i.imgur.com/O4RKNqj.png