When a Github Actions workflow fails, can I notify multiple recipients via email? #43415
Replies: 17 comments 3 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.
-
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