1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- name: Discord Notification
- on:
- release:
- types: [published]
- workflow_dispatch:
- jobs:
- Discord:
- runs-on: ubuntu-latest
- name: Discord Notifier
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - name: Get changed files since last release
- id: changed-files
- uses: tj-actions/changed-files@v34
- with:
- base_sha: ${{ github.event.release.target_commitish }}
- separator: "\n• "
- - name: Discord notification
- env:
- DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
- DISCORD_AVATAR: 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'
- DISCORD_EMBEDS: '[{
- "title": "🚀 New Release: ${{ github.event.release.tag_name }}",
- "description": "${{ github.event.release.name }}\n\n${{ github.event.release.body }}",
- "url": "${{ github.event.release.html_url }}",
- "color": 5763719,
- "thumbnail": {
- "url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
- },
- "fields": [
- { "name": "📦 Version", "value": "`${{ github.event.release.tag_name }}`", "inline": true },
- { "name": "👤 Released by", "value": "[${{ github.event.release.author.login }}](${{ github.event.release.author.html_url }})", "inline": true },
- { "name": "📁 Repository", "value": "[${{ github.event.repository.name }}](${{ github.event.repository.html_url }})", "inline": true },
- { "name": "🔗 Download", "value": "[Release Page](${{ github.event.release.html_url }})", "inline": true },
- { "name": "📝 Files Changed", "value": "• ${{ steps.changed-files.outputs.all_changed_files }}", "inline": false }
- ],
- "timestamp": "${{ github.event.release.published_at }}",
- "footer": {
- "text": "Workout Cool • Release",
- "icon_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
- }
- }]'
- uses: Ilshidur/action-discord@master
- # https://stackoverflow.com/a/68068674/19395252
- # https://birdie0.github.io/discord-webhooks-guide/structure/embeds.html
- # https://github.com/marketplace/actions/changed-files
|