@@ -67,27 +67,40 @@ jobs:
6767 runs-on : ubuntu-latest
6868 timeout-minutes : 3
6969 steps :
70- - name : Add reaction to command comment on success
71- uses : peter-evans/create-or-update-comment@v3
72- if : needs.build-docker.result != 'failure'
73- with :
74- token : ${{ secrets.GIT_PAT }}
75- repository : ${{ github.event.client_payload.github.payload.repository.full_name }}
76- comment-id : ${{ github.event.client_payload.github.payload.comment.id }}
77- body : |
78- > Docker image was pushed with the tag `${{ needs.build-docker.outputs.build_version }}`
79- reactions : " +1"
70+ - name : Details
71+ id : details
72+ shell : bash
73+ run : |
74+ set -xeuo pipefail
75+
76+ case "${{ needs.build-docker.result }}" in
77+ success)
78+ echo "comment=Docker image was pushed with the tag `${{ needs.build-docker.outputs.build_version }}`" >> $GITHUB_OUTPUT
79+ echo "reaction=+1" >> $GITHUB_OUTPUT
80+ ;;
81+ skipped)
82+ echo "comment=Workflow has been skipped" >> $GITHUB_OUTPUT
83+ echo "reaction=confused" >> $GITHUB_OUTPUT
84+ ;;
85+ cancelled)
86+ echo "comment=Workflow has been canceled" >> $GITHUB_OUTPUT
87+ echo "reaction=confused" >> $GITHUB_OUTPUT
88+ ;;
89+ *)
90+ echo "comment=**Error**: failed to execute \"${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}\" command" >> $GITHUB_OUTPUT
91+ echo "reaction=-1" >> $GITHUB_OUTPUT
92+ ;;
93+ esac
8094
81- - name : Add reaction to command comment on failure
95+ - name : Add reaction to command comment
8296 uses : peter-evans/create-or-update-comment@v3
83- if : needs.build-docker.result == 'failure'
8497 with :
8598 token : ${{ secrets.GIT_PAT }}
8699 repository : ${{ github.event.client_payload.github.payload.repository.full_name }}
87100 comment-id : ${{ github.event.client_payload.github.payload.comment.id }}
88101 body : |
89- > **Error**: failed to execute " ${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}" command
90- reactions : " -1 "
102+ > ${{ steps.details.outputs.comment }}
103+ reactions : ${{ steps.details.outputs.reaction }}
91104
92105 help :
93106 if : github.event.client_payload.slash_command.args.unnamed.arg1 == 'help'
0 commit comments