Skip to content

Commit

Permalink
Merge pull request #87 from ArangoGutierrez/slack_bot
Browse files Browse the repository at this point in the history
Customize slack message
  • Loading branch information
ArangoGutierrez authored Aug 19, 2024
2 parents d16115c + 6a1d8c8 commit a60a437
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ jobs:
- name: Check golang modules
run: make check-vendor

- name: Check workflow status
run: |
STATUS_MESSAGE=""
if [ "${{ job.status }}" == "success" ]; then
STATUS_MESSAGE=`:green-check-mark: On repository ${{ github.repository }} the Workflow ${{ github.workflow }} has completed successfully.`
else
STATUS_MESSAGE=`:red_target: On repository ${{ github.repository }} the Workflow ${{ github.workflow }} has failed.`
fi
echo $STATUS_MESSAGE >> $GITHUB_ENV
- name: Send Slack alert notification
id: slack
if: github.event_name == 'push'
Expand All @@ -66,10 +76,6 @@ jobs:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
#slack-message: "GitHub build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
slack-message: |
if [ "${{ job.status }}" == "success" ]; then
:green-check-mark: On repository ${{ github.repository }} the Workflow ${{ github.workflow }} has completed successfully.
else
:red-target: On repository ${{ github.repository }} the Workflow ${{ github.workflow }} has failed.
fi
${{ env.STATUS_MESSAGE }}
Details: ${{ env.SUMMARY_URL }}

0 comments on commit a60a437

Please sign in to comment.