Slack: Add Github CICD Action support

Created on 20 Sep 2019  Â·  21Comments  Â·  Source: integrations/slack

As Github release its CICD service Action, there should be Action notification integrated with slack.

Most helpful comment

@justinpincar That's exactly what I want to say, and I'm now working on this

All 21 comments

Thanks for opening this issue! If you would like to help implement an improvement, read more about contributing and consider submitting a pull request.

Does anyone have a workaround for this right now?

For our team, CI/CD notifications are the most critical and the rest is just noise.

@justinpincar That's exactly what I want to say, and I'm now working on this

Done? Right now in my Slack channel:
obraz

Status on this?

We'd like to be notified for failed workflow runs only in a specific channel

@mcolyer any update on this? let me know if i can be helpful!

No updates. This feature requires Actions/workflow webhook events, which are being discussed, but there is no firm timeline for, unfortunately.

In the meantime, it would be good to firm up the requirements. Here are a few questions to get the ball rolling:

  1. Which workflow-related events do you want (and don't want) to get notified about?
  2. What filters are important to you? (e.g. only notify about failed runs)
  3. Do you want to get notified about all workflows in a repo or just certain ones?
  4. Do you want to get notified about the status of individual jobs in a run, or the entire run?

Thanks for soliciting requirements.
I'd like to subscribe to the failure of cron/periodic workflows for a given repo. I wouldn't mind seeing success AND failure, but obviously I care more about failed periodic actions now. Maybe something like /github subscribe org/repo workflow WorkflowName only_failure would let me view the failed workflows that I expected to trigger periodically.

I'm happy enough with how github actions are reported in the context of a pull request, I'd just like to be able to subscribe to any/all workflows outside of the pull request context.

I'd like to subscribe to at least the end of the workflow and get a list of each job in it and it's status. The current functionality for PR checks is pretty much what I want, but I'd like to get notified each time the workflow runs. That way if I push more changes a few hours or days later a new message will show in Slack letting me know the results.

Picking which workflows to get notified about is also important because I have build/test/deploy workflows that I care about the status of, while PR checks verifying the commit messages are the right format aren't relevant in Slack.

Being able to re-run or cancel a job from in Slack would also be helpful.

The MVP is simply to allow a particular channel to subscribe to workflow runs for any and all statuses (pass/fail) for a particular repository, for a particular branch, and to subscribe to specific job names. That's all.

A feature I would find helpful is to notify of passed workflow only after a failed run.

CircleCI and Bamboo all have a way to do this with slack integration, if you're looking for requirements you could always copy them since we're using github actions instead of CircleCI or Bamboo for build/test validation, and we had github channel notifications for failed runs using both CircleCI and Bamboo.

Isn't this already possible? https://github.com/marketplace/actions/slack-notify

No, because it's about checks & pull requests & issues nor workflow runs.

This would also be super helpful for us at @prisma. We want to have a Slack channel which notifies us about CI failures and successes from the master branch only.

Has anyone workarounds for this? A Slack action would not work since it would not run when a previous step would fail.

@steebchen you can do if: always() on the step - it happens regardless.

Yep, figured it out to do that. However, we have some specific requirements which made us writing our own small action anyway :) My initial thought would be to have a Slack Bot which you could directly subscribe to using a command, for example /github subscribe repo:[branch1,branch2] workflowName etc.

The entire run, and a separate message for each run. The current pull request integration is inadequate.

Left Gitlab for Github and found this is currently not possible. Come on, Github!

Which workflow-related events do you want (and don't want) to get notified about?

  • Workflow started
  • Workflow failed
  • Workflow succeeded

What filters are important to you? (e.g. only notify about failed runs)

See above

Do you want to get notified about all workflows in a repo or just certain ones?

It would be nice to filter but all workflows in a repo is ok.

Do you want to get notified about the status of individual jobs in a run, or the entire run?

No, just the entire run


Example from our TeamCity integration:

Screenshot 2020-10-27 at 11 46 41

Hello. I contacted GitHub Support with the following and was rerouted to this issue. I was told that there is currently no plan on their roadmap (https://github.com/github/roadmap) to make this happen but surely hope that would change in the future. Thanks!


I am looking for a GitHub-Slack integration that focuses on GitHub Actions. That is, I want to be able to define in the Actions YAML to push notification to Slack when a certain job (e.g., scheduled cron job) fails/succeeds. Looking at your official integration doc, I cannot find support for such a thing. I see some third-party Actions out there to do this but I do not want to take a risk and would rather use an official integration if there is one.

So, is there one? If not, you do have a plan/timeline of when that is going to happen?

@pllim I'm just another user waiting for this. I had also played around with some of the third party actions. In the end, the slack API is so simple that I ended up just writing a python script (only because that's my preferred dynamic language) that just uses github APIs to gather information and create a message to post to slack. It only took me a couple of hours. Just be sure to use if: always() if you go this route. I agree that official integration would be ideal, but it's really quite simple to roll your own in the meantime, and it doesn't have to be an action. A plain old run step can do the job.

Fora workflow run I simply wrote two steps in my job: one reports success,
the second has if:failure() and reports that there was a problem. Both use
the above linked action.

So the simple case of reporting status of a workflow is doable with
existing tooling.

On Fri, Dec 11, 2020 at 7:52 AM Jay Berkenbilt notifications@github.com
wrote:

@pllim https://github.com/pllim I'm just another user waiting for this.
I had also played around with some of the third party actions. In the end,
the slack API is so simple that I ended up just writing a python script
(only because that's my preferred dynamic language) that just uses github
APIs to gather information and create a message to post to slack. It only
took me a couple of hours. Just be sure to use if: always() if you go
this route. I agree that official integration would be ideal, but it's
really quite simple to roll your own in the meantime, and it doesn't have
to be an action. A plain old run step can do the job.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/integrations/slack/issues/940#issuecomment-743273091,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAI2Q2GOK7474KE4XB5A7VTSUI52FANCNFSM4IYT45BQ
.

Was this page helpful?
0 / 5 - 0 ratings