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

Add alert for failure in publishing workflow #2070

Merged
merged 2 commits into from
Sep 27, 2023
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
16 changes: 15 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ jobs:
GITHUB_TOKEN: ${{ secrets.KHAN_ACTIONS_BOT_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Send a Slack notification if a publish fails
if: failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_MSG_AUTHOR: ${{ github.event.pull_request.user.login }}
SLACK_USERNAME: GithubGoose
SLACK_ICON_EMOJI: ":goose:"
SLACK_MESSAGE: "Something went wrong with the release of ${{ github.event.repository.name }}. \nPlease check the logs → https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SLACK_TITLE: "Oops! I'm the Bad News Goose!"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that you kept this ❤️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency FTW!

SLACK_FOOTER: Wonder Blocks Slack Notification
MSG_MINIMAL: true

- name: Build Slack message
id: slack_message
if: steps.changesets.outputs.published == 'true'
Expand All @@ -76,7 +90,7 @@ jobs:
SLACK_MSG_AUTHOR: ${{ github.event.pull_request.user.login }}
SLACK_USERNAME: GithubGoose
SLACK_ICON_EMOJI: ":goose:"
SLACK_MESSAGE: "A new version of ${{ github.event.repository.name }} was published! 🎉 \n${{ steps.slack_message.outputs.updated_packages }}\nRelease notes → https://github.com/Khan/${{ github.event.repository.name }}/releases/"
SLACK_MESSAGE: "A new version of ${{ github.event.repository.name }} was published! 🎉 \n${{ steps.slack_message.outputs.updated_packages }}\nRelease notes → https://github.com/${{ github.repository }}/releases/"
SLACK_TITLE: "New Wonder Blocks release!"
SLACK_FOOTER: Wonder Blocks Slack Notification
MSG_MINIMAL: true
Loading