forked from ReVanced/revanced-patches-template
-
Notifications
You must be signed in to change notification settings - Fork 110
42 lines (34 loc) · 1.25 KB
/
discord_ping_on_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Ping Discord on release
on:
release:
types: [published]
jobs:
notify-discord:
runs-on: ubuntu-latest
steps:
- uses: sarisia/actions-status-discord@v1
if: always()
id: webhook # set id to reference output payload later
with:
ack_no_webhook: true # suppress warning
nodetail: true
notimestamp: true
username: ReVanced Extended
content: "<@&1271197877724643461>"
title: "Patches `${{ github.event.release.tag_name }}` has been released!"
description: |
Click [here](${{ github.event.release.html_url }}) to read the changelog and release notes.
- run: npm install axios
- uses: actions/github-script@v7
env:
WEBHOOK_PAYLOAD: ${{ steps.webhook.outputs.payload }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
with:
script: |
const axios = require("axios")
const { WEBHOOK_PAYLOAD, WEBHOOK_URL } = process.env
const payload = JSON.parse(WEBHOOK_PAYLOAD)
// remove the color field to make it transparent
delete payload.embeds[0].color
// send to Discord
axios.post(WEBHOOK_URL, payload)