-
Notifications
You must be signed in to change notification settings - Fork 27
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
[tech] add notification to slack #775
Conversation
- add notification for all jobs to slack in case `failure` and master `branch` - add a Webhook secret in GitHub - add a `global variable` formated message text in workflow
.github/workflows/publish.yml
Outdated
SLACK_TEXT: '{"attachments":[{ | ||
"pretext": "`transit_model Publish` requires your attention!", | ||
"text":" :warning: Publish failed!","color":"#D00000", | ||
"fields":[{"title":"Action URL","value": "https://github.com:/${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(If you want to test it, maybe just use echo
instead of curl
to avoid spamming slack 🥫)
It does work, but it doesn't look like a legit url 🤔
Maybe more:
"fields":[{"title":"Action URL","value": "https://github.com:/${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]} | |
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]} |
Also, I don't know if what's suggested here would work (probably better if possible, as it's straight from official doc): $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i change url and test it. Done
failure
andmaster
branchSLACK_CORE_TOOLS_TEAM_URL
: hereglobal variable
in workflow