Skip to content

Commit

Permalink
cicd: add discord announcement webhook for ChaosMod releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazrius committed Mar 29, 2024
1 parent dfcdd74 commit 60214dd
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/announcement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Post Announcement
on:
workflow_run:
workflows: [ nightly ]
types: [ completed ]
workflow_dispatch:

jobs:
discord:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Get Latest Release
id: version
shell: bash
run: |
JSON=$(curl -L --silent \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/TheStarport/ChaosMod/releases/latest" | \
jq -r '{ "upload_url", "body" }')
URL=$(echo "$JSON" | jq -r .["html_url"])
BODY=$(echo "$JSON" | jq -r .["body"])
echo "URL=$URL" >> $GITHUB_OUTPUT
echo "BODY=$BODY" >> $GITHUB_OUTPUT
- name: Publish to Discord
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK_URL }}
embed-title: Chaos Mod Release Published!
embed-url: ${{ steps.version.outputs.URL }}
embed-color: 65535
embed-description: |
Changelog:
${{ steps.version.outputs.BODY }}

0 comments on commit 60214dd

Please sign in to comment.