Update and rename notify-discord.yml to github-releases-to-discord.yml

This commit is contained in:
Zhe Fang
2025-07-11 19:41:07 -04:00
committed by GitHub
parent a5d6dd1305
commit 7bfbec4b01
2 changed files with 20 additions and 20 deletions

View File

@@ -0,0 +1,20 @@
on:
release:
types: [published, edited]
jobs:
github-releases-to-discord:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: GitHub Releases to Discord
uses: SethCohen/github-releases-to-discord@v1
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
color: "2105893"
username: "Release Changelog"
avatar_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png"
content: "||@everyone||"
footer_title: "Changelog"
reduce_headings: true

View File

@@ -1,20 +0,0 @@
name: Notify Discord on Release
on:
release:
types: [published, edited] # 支持发布和编辑
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send release message to Discord
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"content\": \"📢 Release update: *${{ github.event.release.name }}* by ${{ github.actor }}\n🔗 ${{ github.event.release.html_url }}\"
}" \
$DISCORD_WEBHOOK