Skip to content

Commit

Permalink
[ci] upgrade notification actions
Browse files Browse the repository at this point in the history
+ also small formatting additions
  • Loading branch information
hugsy authored Aug 2, 2023
1 parent ea7ed49 commit d89a516
Showing 1 changed file with 28 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
name: "Discord Notification"

name: "Notifications"

on:
issues:
types:
- opened
- reopened
push:
branches:
- main
- dev

pull_request:
types:
- opened
- closed
branches:
- main
- dev
Expand All @@ -16,56 +22,53 @@ env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}

jobs:
notify:
discord:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: GEF Push Notification
- name: Notify/Push
if: github.event_name == 'push' && github.repository_owner == 'hugsy'
uses: sarisia/actions-status-discord@v1
uses: sarisia/actions-status-discord@v1.12
with:
nodetail: true
title: "[${{ github.repository }}] ${{ github.actor }} pushed to `${{ github.ref }}`"
title: "[${{ github.repository }}] ${{ github.actor }} pushed to `${{ github.ref_name }}`"
description: |
**Commits**:
● ${{ join(github.event.commits.*.message, '
● ') }}
---
**Link**: ${{ github.event.compare }}
color: 0x0000ff
[Open Diff View](${{ github.event.compare }})
color: 0x00ff00
username: ${{ github.actor }} via GithubBot
avatar_url: ${{ github.actor.avatar_url }}

- name: GEF Pull Request Notification
if: github.event_name == 'pull_request' && github.event.action == 'opened'
uses: sarisia/actions-status-discord@v1
- name: Notify/Pull Request
if: github.event_name == 'pull_request'
uses: sarisia/actions-status-discord@v1.12
with:
nodetail: true
title: "[${{ github.repository }}] ${{ github.actor }} created a new Pull Request (`#${{ github.event.pull_request.number }}`)"
title: "[${{ github.repository }}] ${{ github.actor }} ${{ github.event.action }} PR #${{ github.event.pull_request.number }}"
description: |
**${{ github.event.pull_request.title }}**
**Title**: ${{ github.event.pull_request.title }}
---
**Link**: ${{ github.event.pull_request.html_url }}
color: 0x00ff00
[Goto PR](${{ github.event.pull_request.html_url }})
color: 0x0000ff
username: ${{ github.actor }} via GithubBot
avatar_url: ${{ github.actor.avatar_url }}

- name: GEF Issue Notification
if: github.event_name == 'issues' && github.event.action == 'opened' && github.repository_owner == 'hugsy'
uses: sarisia/actions-status-discord@v1
- name: Notify/Issue
if: github.event_name == 'issues' && github.repository_owner == 'hugsy'
uses: sarisia/actions-status-discord@v1.12
with:
nodetail: true
title: "[${{ github.repository }}] ${{ github.actor }} created a new Issue (`#${{ github.event.issue.number }}`)"
title: "[${{ github.repository }}] ${{ github.actor }} ${{ github.event.action}} issue #${{ github.event.issue.number }}"
description: |
**${{ github.event.issue.title }}**
**Title**: ${{ github.event.issue.title }}
---
**Link**: ${{ github.event.issue.html_url }}
[Goto issue](${{ github.event.issue.html_url }})
color: 0xff0000
username: ${{ github.actor }} via GithubBot
avatar_url: ${{ github.actor.avatar_url }}

0 comments on commit d89a516

Please sign in to comment.