When a Github Actions workflow fails, can I notify multiple recipients via email? #43415
Replies: 50 comments 4 replies
-
|
I have similar requirement. Were you able to solve this issue? |
Beta Was this translation helpful? Give feedback.
-
|
Any updates on this ? |
Beta Was this translation helpful? Give feedback.
-
|
I need this too. |
Beta Was this translation helpful? Give feedback.
-
|
This feature was required even nowadays! |
Beta Was this translation helpful? Give feedback.
-
|
+1, multiple people work on pipelines |
Beta Was this translation helpful? Give feedback.
-
|
+1 waiting for any solutions from GitHub |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
By default, GitHub Actions notifies the actor (person who initiated the run) - assuming they haven't tweaked their notification settings. A user can opt in / out of these Action failure notifications. You can use an Action from the GitHub Actions marketplace, but you would need SMTP credentials: https://github.com/marketplace?type=actions&query=email There are cloud services, like Mailgun or Sendgrid, that you can also use to facilitate email sending. You can also set up Teams or Slack integration to post to a channel the results of a job. This is how I most commonly see it at customers. As another workaround option, you can create a new issue / issue comment / comment to a PR and Like this: - uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: create issue comment with failure
run: |
# update 123 with the issue number you are commenting to
gh issue comment 123 -R my-org/my-repo --body "@myorg/myteam: ***Workflow failure*** [View workflow run for details](${{ github.repository.html_url }}/actions/runs/${{ github.run_id}})"
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}You do have to use a GitHub app or personal access token to @ mention a team though (the |
Beta Was this translation helpful? Give feedback.
-
|
@joshjohanning This is such a common use case (notifying a team rather than one specific person) that it should be supported "out of the box" rather than relying on community extensions that are relatively intensive to set up. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
I'm using Google Chat notification. I think there are other notification steps for various platform. |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
|
Any ETA for when this basic functionality will be supported? |
Beta Was this translation helpful? Give feedback.
-
|
+1 It's super basic feature! |
Beta Was this translation helpful? Give feedback.
-
|
Yes, I am surprised this can't be done out of the box. we have a nightly job, and it is just random who gets notified about its failure (just whoever happened to merge in the most recent PR). not intuitive at all! |
Beta Was this translation helpful? Give feedback.
-
|
I'm using GitHub Actions daily for more than four years and my experience is that they do not care about normal user feedback and needs. I can see some enterprise "features" added from time to time but nothing needed or useful to the community. So do not put much hope in them. There are some common workarounds to the missing notifications feature like:
|
Beta Was this translation helpful? Give feedback.
-
|
+1 can't believe there isn't a simple way to do this |
Beta Was this translation helpful? Give feedback.
-
|
You can here see an example of how we implemented this using the rtCamp/action-slack-notify action: notify-on-failure:
if: failure()
needs: ["lint", "build", "test-unit", "test-integration", "test-invariant", "test-fork"]
runs-on: "ubuntu-latest"
steps:
- name: "Send Slack notification"
uses: "rtCamp/action-slack-notify@v2"
env:
SLACK_CHANNEL: "#ci-notifications"
SLACK_MESSAGE: "CI Workflow failed for ${{ github.repository }} on branch ${{ github.ref }} at job ${{ github.job }}."
SLACK_USERNAME: "GitHub CI"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} |
Beta Was this translation helpful? Give feedback.
-
|
I'm leaving an organization where I've configured many cron schedule workflows. Right now, I'm the maintainer as well, so it makes sense that I get the email on failure. When I leave, these workflows will just silently fail with no notification system. Please Github, just a basic feature to configure a mailing list for actions failures! |
Beta Was this translation helpful? Give feedback.
-
|
I require this in my workflows too. |
Beta Was this translation helpful? Give feedback.
-
|
+42 |
Beta Was this translation helpful? Give feedback.
-
|
+1 |
Beta Was this translation helpful? Give feedback.
-
|
Use a Team Messaging Platform
or you can Use a Dedicated Email Service 📧 How it works:
|
Beta Was this translation helpful? Give feedback.
-
|
+one million How is this not out of the box? |
Beta Was this translation helpful? Give feedback.
-
|
+1 Please, this feature would be very useful, specially in enterprise scenarios. |
Beta Was this translation helpful? Give feedback.
-
|
+1 Asking for this yet again! Would simplify many of our workflows |
Beta Was this translation helpful? Give feedback.
-
|
+! again, this would be so useful for us |
Beta Was this translation helpful? Give feedback.
-
|
Come on, please @github |
Beta Was this translation helpful? Give feedback.
-
|
Hello All, I also had similar requirements. However, I used Sendgrid and is working fine and meeting my Requirements. Sharing it here if it helps others too. (You may ignore if it doesn't help in this context)
Thanks & Regards, |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
By default, only the person who triggers the workflow or the person setting up the workflow gets an email notification on job failure.
Docs: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/notifications-for-workflow-runs
There is a workaround by adding an extra step (listed below) in the workflow, it claims to send the notification to multiple recipients, but this requires me to store my email username and password as a secret on GitHub, which I don't prefer to do.
Extra step: https://stackoverflow.com/questions/62304258/github-actions-notifications-on-workflow-failure/67265461#67265461
I have to send the failure notification to my team of 4. Any ideas on tackling this problem would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions