Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify workflows only on errors #1563

Open
samsaggace opened this issue Dec 8, 2022 · 63 comments
Open

Notify workflows only on errors #1563

samsaggace opened this issue Dec 8, 2022 · 63 comments
Assignees

Comments

@samsaggace
Copy link

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 :
image
without in progress and in thread details

Thanks !

@ashokirla
Copy link
Contributor

Thanks for the feedback. We will collate all the requests and pick it up during the next iteration of improvements.

@a-pedroso
Copy link

This feature would be super useful.
thumbs up!

@danielsiwiec
Copy link

+1 🙏

@Yarden-zamir
Copy link

Is there any update on this? This would be very useful

@surajthapa12
Copy link

surajthapa12 commented Mar 28, 2023

@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?

@pashcan
Copy link

pashcan commented Apr 5, 2023

The ability to subscribe to only the failed workflows would be super helpful to help reduce the notification noise 🙏

@mknet3
Copy link

mknet3 commented Apr 10, 2023

any update here? 🙏 It would be awesome to avoid including many extra steps in all the workflows just for notifications

@connorjchen
Copy link

Would be super helpful

@MerzDaniel
Copy link

MerzDaniel commented Apr 25, 2023

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

@MerzDaniel
Copy link

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" }

@rohammosalli
Copy link

rohammosalli commented May 3, 2023

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

@phisco
Copy link

phisco commented May 4, 2023

+1!

@Shekhar-rv
Copy link

+1

@NegatioN
Copy link

NegatioN commented May 11, 2023

+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 🙏

@fivestar
Copy link

+1

@rohammosalli
Copy link

rohammosalli commented May 17, 2023

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

@yoannteruel
Copy link

+1

3 similar comments
@TakeshiDaveau
Copy link

+1

@xnog
Copy link

xnog commented Jun 2, 2023

+1

@kendra-human
Copy link

+1

@danlester
Copy link

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.

@gs-emp
Copy link

gs-emp commented Jun 12, 2023

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 }}

image
@samsaggace

@Shashwat-SRE
Copy link

@ashokirla any update on when this will be implemented ?

@vahmed-hamdy
Copy link

+1 on that, seriously needed

@fimasultana
Copy link

Is there an update for failed job alerts integration in Slack only?

@vrumiantsev
Copy link

+1 This feature would be super helpful in order to reduce channel noise

@danlester
Copy link

Screenshot 2024-04-03 at 14 44 46

A friendly reminder that Endid offers enhanced customization (it can even notify only on first failure, and/or first fix). It's free for public repos.

@AMMARESIDENTE
Copy link

AMMARESIDENTE commented Apr 3, 2024 via email

@haizaar
Copy link

haizaar commented Apr 20, 2024

Is GitHub becoming one of those products that take forever to deliver simple usability improvements?

@szymanka
Copy link

0_PUSS-IN-BOOTS

dime10 pushed a commit to PennyLaneAI/catalyst that referenced this issue Apr 26, 2024
**Context:**
It is useful to receive notifications whenever a github action workflow
running on mail fails. Github has a slack integration that can be
configured, but that sends notification for every job in any
state(started, cancelled, failed, succeeded). There is an [open
issue](integrations/slack#1563) that hasn't
been solved for 2 years.
Because of this, a manual job that triggers based on failures of
selected job on main is a better approach, and it won't need to add the
notification on each single job.

**Description of the Change:**
A new workflow is added that will send notification to a slack
channel(specified in the webhook configuration in the slack settings).

**Benefits:**
Get notification when specified jobs fails on main

**Possible Drawbacks:**
None

**Related GitHub Issues:**
None
@josh-hong-pps
Copy link

+1

@aa-mikemonaghan
Copy link

+1, I'm surprised this is a limitation of the platform in 2024.

Having to resort to Slack webhooks and third-party/internal Actions to get this functionality is pretty silly.

@AMMARESIDENTE
Copy link

AMMARESIDENTE commented Jun 18, 2024 via email

@illegalnumbers
Copy link

Any update on this?

@kuronekomichael
Copy link

I eagerly anticipating the resolution of this issue 😢

@PramodKumarYadav
Copy link

PramodKumarYadav commented Jul 3, 2024

The person assigned to this issue has not added any commit in this year so most probably he is not working there any more. Its a pity that even after so many votes the issue doesn't have any priority.

The noisy official integration is completely useless without the ability to filter on failing workflows :/

@hiroshi-yoodli
Copy link

I contacted GitHub support team under our organization's GitHub enterprise plan, and I got a reply:

I made sure to add the issue you linked to our internal feature request for this functionality. So your inquiry, along with the comments and reactions in the issue, are taken into account by our product management team.

Because it explains that they have internal request tracking system, I recommend other people to do the same, so that our voices are amplified, beyond this public forum.

@OmarTawfik
Copy link

Seems like they added workflow notification filters, which support name, event, actor, and branch filters:
https://github.com/integrations/slack?tab=readme-ov-file#workflow-notification-filters

The one filter that is missing (and I believe is actually the most important filter of all) is conclusion, so that people can filter by event.workflow_run.conclusion, which is either success or failure:
https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow

I suspect it is now much easier/cheaper to implement this feature, which is immensely helpful to anyone working on large codebases.

@ichbinjon
Copy link

+1 to this, would be super useful

@zendesk-johnhenry
Copy link

+1

@cquaresma
Copy link

+1 let us eat cake.

@Tom-Hudson
Copy link

+1

1 similar comment
@davidhazell-tst
Copy link

+1

@tailaiw
Copy link

tailaiw commented Oct 25, 2024

Seems like they added workflow notification filters, which support name, event, actor, and branch filters: https://github.com/integrations/slack?tab=readme-ov-file#workflow-notification-filters

The one filter that is missing (and I believe is actually the most important filter of all) is conclusion, so that people can filter by event.workflow_run.conclusion, which is either success or failure: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow

I suspect it is now much easier/cheaper to implement this feature, which is immensely helpful to anyone working on large codebases.

I'm not optimistic about this because the event is something known on trigger, while the conclusion is something known on the end of the workflow. I hope I'm wrong because obviously this is a much needed feature.

@tuliolima
Copy link

+1

@alberto-corrales
Copy link

it would be amazing to have these filters available to prevent generating noise in our channels. It is true we can also do it with webhooks, but it would be nice if we could leverage the Github app

@matifali
Copy link

matifali commented Nov 18, 2024

I wish the integration were opensource, so a user could just contribute this themselves instead of waiting on the Slack team for 2 years.

Also, Looks like @ashokirla is no longer an active GitHub account.

@na-jakobs
Copy link

This is a much needed feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests