From 8e7f5b4d927452d606f1cdbf8083ce75c4f74266 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Wed, 24 Jul 2024 21:13:19 -0400 Subject: [PATCH] ci: pass message-id between jobs --- .forgejo/workflows/ci.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 2d33a28..4d1e84b 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -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 }}