Update build.yml
Fixed discord notification (at long last!)
This commit is contained in:
@@ -135,13 +135,24 @@ jobs:
|
|||||||
|
|
||||||
notify:
|
notify:
|
||||||
name: Notify Discord
|
name: Notify Discord
|
||||||
needs: [buildwindows, buildmacos, buildlinux]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- id: msg_var
|
||||||
|
name: remove newlines
|
||||||
|
run: |
|
||||||
|
export release_msg=$(cat << EOF
|
||||||
|
${{ github.event.head_commit.message }}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
release_msg="${release_msg//$'\n'/'-'}"
|
||||||
|
release_msg="${release_msg//$'\r'/'-'}"
|
||||||
|
echo $release_msg
|
||||||
|
echo "::set-output name=msg::$release_msg"
|
||||||
|
|
||||||
- name: Notify Discord
|
- name: Notify Discord
|
||||||
run: |
|
run: |
|
||||||
curl -i -H "Accept: application/json" \
|
curl -i -H "Accept: application/json" \
|
||||||
-H "Content-Type:application/json" \
|
-H "Content-Type:application/json" \
|
||||||
-X POST \
|
-X POST \
|
||||||
--data "{\"content\": null,\"embeds\": [{\"title\": \"${{ github.repository }} Build Complete\", \"description\": \"${{ github.event.head_commit.message }}\\nCommit: ${{ github.sha }}\\n[Build Artifacts](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts)\", \"color\": 5131997, \"author\": { \"name\": \"Github Builds\" } } ]}" \
|
--data "{\"content\": null,\"embeds\": [{\"title\": \"${{ github.repository }} Build Complete\", \"description\": \"${{ steps.msg_var.outputs.msg }} \\nCommit: ${{ github.sha }}\\n[Build Artifacts](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts)\", \"color\": 5131997, \"author\": { \"name\": \"Github Builds\" } } ]}" \
|
||||||
https://discord.com/api/webhooks/${{ secrets.WEBHOOK_ID }}/${{ secrets.WEBHOOK_TOKEN }}
|
https://discord.com/api/webhooks/${{ secrets.WEBHOOK_ID }}/${{ secrets.WEBHOOK_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user