Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize slack message #87

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
@@ -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'
@@ -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 }}