slack
slack copied to clipboard
Add Github CICD Action support
As Github release its CICD service Action, there should be Action notification integrated with slack.
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:

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:
- Which workflow-related events do you want (and don't want) to get notified about?
- What filters are important to you? (e.g. only notify about failed runs)
- Do you want to get notified about all workflows in a repo or just certain ones?
- 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
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:
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 [email protected] 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 .
I strongly disagree with the comments saying that this feature would be equivalent with using a Slack action in a workflow.
This feature is about monitoring workflows using Slack alerts, regardless of how they're implemented, which actions they use or what events trigger them.
- The Slack integration already supports subscriptions in multiple channels, for any Slack action, one needs to duplicate the code.
- Using a Slack action requires modifying any workflow that should report its status - if this is omitted or the condition is not right, no status reports would be sent out.
- A Slack action also requires a suitable webHook URL to be setup and stored as a repository secret. Setting this up for each repo is a big hassle.
- Furthermore, in a workflow using multiple jobs, aggregating them to find out which job failed requires extra logic and leads to ugly, bloated workflows.
It would be amazing if GitHub would implement such a simple feature, given that many other events are already available to be used with the slack integration.
Setting up a subscription for the current Slack channel with a possibility to filter by event could look like
/github subscribe org/repository actions/scheduled
/github subscribe org/repository actions/pull_request
/github subscribe org/repository actions/*,!actions/push
Any update on this? This would be super helpful.
As others have mentioned the main important things would be:
- Choose which workflow to monitor
- Possible to only notify on failure
- Each steps are not so much important as you can go see the workflow details if you have a link to it in slack
- It is different than a slack-notify github action, because the latter requires you to modify each action, while a monitor lets you plug/unplug monitoring whenever you want it without modifying the workflow code itself.
Hi to confirm that I have the same issue. The problem here is that the notification is sent on PR not scheduled runs of the same workflow?
We ended up building our own Slack/GitHub integration specifically to handle Actions Workflows. Even if GitHub does build support for actions in their native app, I figured they are unlikely to dive into the nuances of surfacing only failed runs or those where the status changes from failed to success or back again.
As others have said here, it needs more intelligent monitoring than an action step can provide - you end up with a lot of noise, especially during heavy development. We can easily build 'mute' functionality into our integration, for example.
I am working to make it publicly available and will let you know here when you can try it out - should be just a couple of weeks. Feel free to email me directly if you're excited enough to try out the test version now!
That is awesome! For those whose needs are met by an action, we made slack-templates and have been satisfied with it over the past eight months. It sends concise messages with templates for job/workflow statuses, review requests, and PR assignments. To notify only on failure, simply replace if: always() with if: failure() in the examples in the docs. It is written in Python. The existing templates required about 10 unique lines of code each, and new contributions are certainly welcome. Alternatively, you can send custom messages out-of-the-box if they are simple enough to craft in YAML rather than Python. You do need to set up secrets for your Slack bot to authenticate, but with the exception of private repos on the free plan, secrets can be shared throughout an organization. If you have any suggestions, please open a an issue!
As promised, I'm letting you know my Slack app is now live in the app directory!
It monitors your GitHub Actions and pings the Slack channel of your choice when the status changes.
This doesn't need any code to be added to your workflows, and configuration is all through a simple UI inside Slack.
You can choose to be notified of any or all statuses (queued, success, failure, canceled), and optionally choose to be notified only when the state changes - when a workflow that was previously successful suddenly fails, and then once it is fixed again.
At the moment, all workflows are monitored, so just install on the relevant repos that you want to know about. I would like to add the ability to set rules specific to different workflows, e.g. different channels and notification frequencies.
Please give Endid a try and let me know what you think!