@@ -13,18 +13,6 @@ concurrency:
13
13
14
14
jobs :
15
15
status_embed :
16
- # We send the embed in the following situations:
17
- # - Always after the `Build & Deploy` workflow, as it runs at the
18
- # end of our workflow sequence regardless of status.
19
- # - Always for the `pull_request` event, as it only
20
- # runs one workflow.
21
- # - Always run for non-success workflows, as they
22
- # terminate the workflow sequence.
23
- if : >-
24
- (github.event.workflow_run.name == 'Build & Deploy' && github.event.workflow_run.conclusion != 'skipped') ||
25
- github.event.workflow_run.event == 'pull_request' ||
26
- github.event.workflow_run.conclusion == 'failure' ||
27
- github.event.workflow_run.conclusion == 'cancelled'
28
16
name : Send Status Embed to Discord
29
17
runs-on : ubuntu-latest
30
18
@@ -42,10 +30,10 @@ jobs:
42
30
curl -sSL -H "Authorization: token $GITHUB_TOKEN" -o pull_request_payload.zip $DOWNLOAD_URL || exit 2
43
31
unzip -p pull_request_payload.zip > pull_request_payload.json
44
32
[ -s pull_request_payload.json ] || exit 3
45
- echo "::set-output name= pr_author_login:: $(jq -r '.user.login // empty' pull_request_payload.json)"
46
- echo "::set-output name= pr_number:: $(jq -r '.number // empty' pull_request_payload.json)"
47
- echo "::set-output name= pr_title:: $(jq -r '.title // empty' pull_request_payload.json)"
48
- echo "::set-output name= pr_source:: $(jq -r '.head.label // empty' pull_request_payload.json)"
33
+ echo "pr_author_login= $(jq -r '.user.login // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
34
+ echo "pr_number= $(jq -r '.number // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
35
+ echo "pr_title= $(jq -r '.title // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
36
+ echo "pr_source= $(jq -r '.head.label // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
49
37
env :
50
38
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51
39
60
48
webhook_id : ' 784184528997842985'
61
49
webhook_token : ${{ secrets.GHA_WEBHOOK_TOKEN }}
62
50
51
+ # We need to provide the information of the workflow that
52
+ # triggered this workflow instead of this workflow.
53
+ workflow_name : ${{ github.event.workflow_run.name }}
54
+ run_id : ${{ github.event.workflow_run.id }}
55
+ run_number : ${{ github.event.workflow_run.run_number }}
63
56
status : ${{ github.event.workflow_run.conclusion }}
57
+ sha : ${{ github.event.workflow_run.head_sha }}
58
+
64
59
pr_author_login : ${{ steps.pr_info.outputs.pr_author_login }}
65
60
pr_number : ${{ steps.pr_info.outputs.pr_number }}
66
61
pr_title : ${{ steps.pr_info.outputs.pr_title }}
0 commit comments