slack
slack copied to clipboard
Notify workflows only on errors
Is your feature request related to a problem? Please describe. To avoid generating too much noise on our slack channel, I would like to get a notification on workflows only when it fails.
Describe the solution you'd like
Adding this configuration like workflows:{event:"push", branch:"main", when: "failed" }
would be super useful.
Describe alternatives you've considered For the moment we are using a github action (ravsamhq/notify-slack-action) to do the job but it has to be added on every job of every workflow...
Additional context
To be clear, having only this notification on workflows would be perfect for me :
without in progress and in thread details
Thanks !
Thanks for the feedback. We will collate all the requests and pick it up during the next iteration of improvements.
This feature would be super useful. thumbs up!
+1 🙏
Is there any update on this? This would be very useful
@ashokirla
Thanks for the feedback. We will collate all the requests and pick it up during the next iteration of improvements.
Thank you. Quick question, any clue on when the next iteration of improvements will be released?
The ability to subscribe to only the failed workflows would be super helpful to help reduce the notification noise :pray:
any update here? 🙏 It would be awesome to avoid including many extra steps in all the workflows just for notifications
Would be super helpful
Waiting desperately for this. Otherwise notifications for many repositories are too spammy
[edit] We have multiple teams maintaining ~50 small repos each. Usually builds pass due to our good test coverage, so the only notifications on build fails and fixed builds are important for us
Jenkins has the nice feature for notifying on
- failed builds
- fixed builds (first successful build after a fail)
So extending the config as in the main description could be something like this:
workflows:{event:"push", branch:"main", when: "failed,fixed" }
Hi, @bkeepers @ashokirla you can improve GitHub Actions workflow configuration to make notifications more efficient. I propose implementing a configuration such as: workflows:{event:"pull_request","push", "schedule", when: "failed"}
This configuration ensures that we receive notifications only when a workflow has failed, making it easier to focus on issues that need immediate attention. Once the failed workflow is resolved and we receive a green notification
+1!
+1
+1 Not having this makes this otherwise perfect integration almost unusable in our case. It would be great to hear an update on when we could expect someone to start work on this @ashokirla :pray:
+1
I created a custom Github action that supports these conditions. it also checks all failed jobs no need anything to add inside the workflow file, you can add it as a separate job to your workflow.
- Send a success message if the last build failed but the current build was successful.
- or don’t sends notifications for successful workflow runs if you set
SEND_SUCCESS_NOTIFICATIONS
environment variable to false. - Send a message if there was a failed build.
You can check it here: https://github.com/rohammosalli/slack-action
+1
+1
+1
+1
Before any updates are released on the official GitHub app, anyone wanting more flexibility over workflow notifications can try Endid (free for open-source repos).
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.
This offers drastically reduced noise for a lot of organizations, compared to the official integration! Hope it helps some of you here for now.
The Endid Slack app is linked here.
Hi all - This is my checker so I don't need to add it to every job.
name: Check for master or prod failure
on:
workflow_run:
workflows: [Build and Test, Build and Test 2]
types: [completed]
branches: [main,prod]
jobs:
on-failure:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out'
steps:
- uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ github.event.workflow_run.conclusion }}
notification_title: " ${{github.event.workflow_run.name}} - ${{github.event.workflow_run.conclusion}} on ${{github.event.workflow_run.head_branch}} - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
message_format: ":fire: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <${{github.server_url}}/${{github.repository}}/${{github.event.workflow_run.head_branch}}|${{github.repository}}>"
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.MASTER_PROD_FAIL_SLACK }}
@samsaggace
@ashokirla any update on when this will be implemented ?
+1 to this. Would be very useful for us to only know about the errors without having to modify our workflow file across multiple repos.
for god's sake please.
Shame I have to install custom action and deal with Slack hooks. Does anyone at GitHub still maintain this integration?
has there been any progress on this? This would be a very useful feature.
+1 to wanting this feature. I am getting around this with slack notifications but would love to get rid of that.
+1
+1 Just out of curiosity, why would anyone want to subscribe to all events if everything works as it should? I mean, if the output is meant for human consumption on a slack channel :)