Web Analytics

What’s happening at Joshu?

Implementing cascading merges in GitHub Actions (Part 3)

  • Zohar ZilbermanZohar Zilberman
  • December 2022
Merging

In Part 1 and Part 2 we implemented cascading merges using GitHub Actions.

This short and last post adds Slack notifications for when releases are created and when a merge has failed.

Create a Slack Incoming Webhook

To send notifications from GitHub Actions to Slack, follow this guide to create an incoming webhook in your Slack workspace: https://api.slack.com/messaging/webhooks.

Once you have the webhook URL (looks like https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX), save it in a repo or organization secret named SLACK_WEBHOOK_URL.

Merge forward workflow (from Part 1)

Here we’ll add a final step to .github/workflows/merge-forward.yaml that only runs in case of a failure.

The new step uses slackapi/slack-github-action and the webhook URL we created in the previous section.

Create next release workflow (from Part 2)

We’ll add a new step to .github/workflows/create-next-release.yaml that sends a message about the new release and the change to the default branch.

That’s it!

For easier reference, here are gists for the full workflows: