avatar
Published on

Top 4 GitHub Action Slack integrations

Authors

For the past years, as most engineering teams on GitHub, you must have integrated GitHub Actions and workflows in your routine. GitHub Action is great for continuous integration, continuous deployment, and monitoring your workflows.

In order to receive the right information in your Slack, there are two possibilities to set up notifications for GitHub Actions. The first one is to add an open-source project to your repositories and to use the Slack API through a GitHub Action, the second one is to install an application with a user interface to set up your notifications. We’re going to explain the best of both worlds in this article.

Three open-source applications to receive GitHub Action to Slack

During our study, we’ve found four applications on the GitHub marketplace to set up GitHub Action notifications to Slack. We decided to focus on the top three that had more than 100 stars at the time of the article.

Slack notify

This application was created by rtCamp and has 534 stars on GitHub. They developed two other applications for GitHub Action: PHPCS Code Review and Deploy WordPress.

Their API is well-documented and explained. Optionally, Slack notify can support Hashicorp Vault too.

How to use it:

    - name: Slack Notification
      uses: rtCamp/action-slack-notify@v2
      env:
        SLACK_CHANNEL: general
        SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
        SLACK_ICON: https://github.com/rtCamp.png?size=48
        SLACK_MESSAGE: 'Post Content :rocket:'
        SLACK_TITLE: Post Title
        SLACK_USERNAME: rtCamp
        SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Slack Notify

From there, you can easily add this setup to any of your current GitHub Action and ask Slack notify to send you notifications in a dedicated channel.

GitHub Action for Slack

GitHub Action for Slack was developed by Nicolas Coutin and Christoper Lion and has currently 181 stars on GitHub. The API is well documented too but messages are pretty simple and do not fully use Slack attachment API.

How to use it:

- name: Slack notification
  env:
    SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
    SLACK_USERNAME: ThisIsMyUsername # Optional. (defaults to webhook app)
    SLACK_CHANNEL: general # Optional. (defaults to webhook)
    SLACK_AVATAR: repository # Optional. can be (repository, sender, an URL) (defaults to webhook app avatar)
  uses: Ilshidur/action-slack@2.0.2
  with:
    args: 'A new commit has been pushed.' # Optional

Example:

GitHub Action for Slack

Action Slack

action-slack was developed by 8398a7 and other contributors and has currently 386 stars on GitHub.

We love the online documentation and the overall rich attachment interface, even if a quick design on the default appearance could be beneficial. But this is the only one to provide a way to customize the appearance of the notifications and they support GitHub Enterprise too!

How to use it:

steps:
  - uses: 8398a7/action-slack@v3
    with:
      status: ${{ job.status }}
      fields: repo,message,commit,author,action,eventName,ref,workflow,job,took # selectable (default: repo,message)
    env:
      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
    if: always() # Pick up events even if the job fails or is canceled.

Example:

Action Slack

Axolo, a user interface to receive GitHub Action in Slack and much more

Pull request and repository-wide GitHub action

Axolo’s first feature is to create a single-purpose ephemeral channel for each pull request in Slack. Then, we send every notification related to the pull request in this specific channel, so GitHub actions too!

After installation, you will be able to receive every GitHub Action notification in a pull request channel in Slack (notifying only the pull request creators and reviewers) or in the main channel for repository-wide GitHub Action for the whole team. You are able to decide in the Axolo UI which GitHub Action notifications you wish to receive.

Customize which notifications to receive

In the admin panel, you can select which status you want to receive. The default setting for GitHub Action and deployment notifications is to receive every status except ‘success’. This enables the team to be notified only when something went wrong. But you can decide to receive ‘success’ too if you would like to.

How to select any status:

GitHub action status

A GitHub Action notification will look like this (the color change upon the status):

GitHub Action Axolo example

If you know any other great integrations for GitHub Action in Slack, let us know and we will update the article!

Ready to dive in?Try Axolo for free.