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

[tech] add notification to slack #775

Merged
merged 9 commits into from
May 5, 2021

Conversation

Moomoo-Seukla
Copy link

@Moomoo-Seukla Moomoo-Seukla commented May 3, 2021

  • add notification for each job to slack in case failure and master branch
  • add a Webhook secret in GitHub SLACK_CORE_TOOLS_TEAM_URL : here
  • add a message text global variable in workflow

Moomoo-Seukla added 2 commits May 3, 2021 20:02
 - 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
@Moomoo-Seukla Moomoo-Seukla requested a review from pbougue May 3, 2021 18:49
@Moomoo-Seukla Moomoo-Seukla requested a review from pbougue May 4, 2021 16:48
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 }}"}]}
Copy link
Contributor

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:

Suggested change
"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

Copy link
Author

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

@Moomoo-Seukla Moomoo-Seukla merged commit b48462b into master May 5, 2021
@Moomoo-Seukla Moomoo-Seukla deleted the slack_notification_case_failure_master branch May 5, 2021 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants