Skip to content

Commit

Permalink
ci: Use semi-transparent Discord embed color
Browse files Browse the repository at this point in the history
  • Loading branch information
KobeW50 committed Dec 22, 2024
1 parent ed94c20 commit 66dbbb1
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/discord_ping_on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,33 @@ jobs:
steps:
- uses: sarisia/actions-status-discord@v1
if: always()
id: webhook # set id to reference output payload later
with:
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
username: ReVanced Extended
color: 0xff5252
ack_no_webhook: true # suppress warning
nodetail: true
notimestamp: true

username: ReVanced Extended
content: "<@&1271198236350087283>"
title: "RVX-Builder `${{ github.event.release.tag_name }}` has been released!"
description: |
Click [here](${{ github.event.release.html_url }}) to download it and read the changelog.
- 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)

0 comments on commit 66dbbb1

Please sign in to comment.