From 3ac0363ca13d3a0971d0b1f9a7a9983ecd4055df Mon Sep 17 00:00:00 2001 From: Hrutvik Kanabar Date: Fri, 9 Aug 2024 23:17:12 +0100 Subject: [PATCH] Add a description to Discord notification --- .github/workflows/pure.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/pure.yml b/.github/workflows/pure.yml index 26970761..ed59a591 100644 --- a/.github/workflows/pure.yml +++ b/.github/workflows/pure.yml @@ -206,6 +206,7 @@ jobs: "title": "PureCake CI #${{ github.run_number }}: ${{ needs.build.result }}", "url": "https://github.com/CakeML/pure/actions/runs/${{ github.run_id }}", "color": ${{ needs.build.result == 'success' && 8311585 || 13632027 }}, + "description": "$DESCRIPTION", "fields": [ {"name": "HOL commit", "inline": true, "value": "[${{ needs.build.outputs.hol_short_sha }}](https://github.com/HOL-Theorem-Prover/HOL/commit/${{ needs.build.outputs.hol_sha }})"}, @@ -213,3 +214,14 @@ jobs: "value": "[${{ needs.build.outputs.cakeml_short_sha }}](https://github.com/CakeML/cakeml/commit/${{ needs.build.outputs.cakeml_sha }})"}] }]}' ${{ secrets.DISCORD_WEBHOOK }} + env: + DESCRIPTION: |- + ${{ + github.event_name == 'workflow_dispatch' && + format('Manually triggered by {0}', github.event.sender.login) + || github.event_name == 'pull_request' && + format('[Pull request #{0}](https://github.com/CakeML/pure/pull/{0})', github.event.number) + || github.event_name == 'push' && + format('Push by {0}', github.event.pusher.username || github.event.pusher.name) + || 'Weekly scheduled run' + }}