1
0
Fork 0

ci: pass message-id between jobs
All checks were successful
/ pre-run-notify (push) Successful in 32s
/ sast (push) Successful in 53s
/ post-run-notify (push) Successful in 34s

This commit is contained in:
Marc 2024-07-24 21:13:19 -04:00
parent c845bea64b
commit 8e7f5b4d92
Signed by: marc
GPG key ID: 048E042F22B5DC79

View file

@ -10,7 +10,12 @@ jobs:
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
status: "Started"
- run: echo ${{ steps.post-status.outputs.message-id }}
- run: echo ${{ steps.post-status.outputs.message-id }} >> /tmp/discord-message-id
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
path: /tmp/discord-message-id
name: "${{ github.sha }}-${{ github.run_number }}-discord-message-id"
overwrite: true
sast:
runs-on: ubuntu-latest
steps:
@ -26,15 +31,23 @@ jobs:
runs-on: ubuntu-latest
if: always()
steps:
- uses: https://code.forgejo.org/forgejo/download-artifact@v4
with:
name: "${{ github.sha }}-${{ github.run_number }}-discord-message-id"
path: /tmp
- id: get-discord-message-id
run: echo "message-id=$(cat /tmp/discord-message-id)" >> $GITHUB_OUTPUT
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
if: ${{ success() }}
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
variant: "success"
status: "Success"
message-id: ${{ steps.get-discord-message-id.outputs.message-id }}
- uses: https://forge.karnov.club/marc/push-status-to-discord-action@main
if: ${{ failure() }}
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
variant: "failure"
status: "Failure"
message-id: ${{ steps.get-discord-message-id.outputs.message-id }}