ci: remove discord notification from release (#2501)
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
This commit is contained in:
39
.github/workflows/release.yml
vendored
39
.github/workflows/release.yml
vendored
@@ -304,42 +304,3 @@ jobs:
|
|||||||
run: gh release edit "${{ env.VERSION }}" --draft=false --repo "${{ github.repository }}"
|
run: gh release edit "${{ env.VERSION }}" --draft=false --repo "${{ github.repository }}"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
discord:
|
|
||||||
name: Send Discord Notification
|
|
||||||
needs: publish-release
|
|
||||||
if: always()
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Determine status
|
|
||||||
id: status
|
|
||||||
run: |
|
|
||||||
case "${{ needs.publish-release.result }}" in
|
|
||||||
success) echo "status=Success" >> $GITHUB_OUTPUT; echo "colour=3066993" >> $GITHUB_OUTPUT ;;
|
|
||||||
failure) echo "status=Failure" >> $GITHUB_OUTPUT; echo "colour=15158332" >> $GITHUB_OUTPUT ;;
|
|
||||||
cancelled) echo "status=Cancelled" >> $GITHUB_OUTPUT; echo "colour=10181046" >> $GITHUB_OUTPUT ;;
|
|
||||||
*) echo "status=Skipped" >> $GITHUB_OUTPUT; echo "colour=9807270" >> $GITHUB_OUTPUT ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
- name: Send notification
|
|
||||||
run: |
|
|
||||||
WEBHOOK="${{ secrets.DISCORD_WEBHOOK }}"
|
|
||||||
|
|
||||||
PAYLOAD=$(cat <<EOF
|
|
||||||
{
|
|
||||||
"embeds": [{
|
|
||||||
"title": "${{ steps.status.outputs.status }}: ${{ github.workflow }}",
|
|
||||||
"color": ${{ steps.status.outputs.colour }},
|
|
||||||
"fields": [
|
|
||||||
{ "name": "Repository", "value": "[${{ github.repository }}](${{ github.server_url }}/${{ github.repository }})", "inline": true },
|
|
||||||
{ "name": "Ref", "value": "${{ github.ref }}", "inline": true },
|
|
||||||
{ "name": "Event", "value": "${{ github.event_name }}", "inline": true },
|
|
||||||
{ "name": "Triggered by", "value": "${{ github.actor }}", "inline": true },
|
|
||||||
{ "name": "Workflow", "value": "[${{ github.workflow }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})", "inline": true }
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
|
|
||||||
curl -sS -H "Content-Type: application/json" -X POST -d "$PAYLOAD" "$WEBHOOK" || true
|
|
||||||
|
|||||||
Reference in New Issue
Block a user