Replies: 1 comment
-
|
Yes , there is a simpler way, but GitHub / ARC does not provide a built-in “send custom email from workflow” step by itself. The native notification system only sends standard workflow status emails (success / failure / cancelled), and you can enable “only failed workflows,” but you cannot customize the email body for specific CI conditions. ([GitHub Docs]1) So for a custom message like:
you generally need one of these practical approaches: 1) Simplest practical solution → use an email actionThe lightest way is to use a marketplace action such as Example: - name: Check condition
id: check
run: |
if [ "$condition" = "true" ]; then
echo "status=satisfied" >> $GITHUB_OUTPUT
else
echo "status=failed" >> $GITHUB_OUTPUT
fi
- name: Send custom email
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
subject: CI Notification - ${{ steps.check.outputs.status }}
body: |
Condition result: ${{ steps.check.outputs.status }}
Repository: ${{ github.repository }}
Workflow: ${{ github.workflow }}
to: your-email@example.com
from: CI BotThis is currently the most common and straightforward solution. ([Stack Overflow]2) 2) Easier than SMTP → use issue / PR comments instead of emailIf email feels overkill, a much simpler workflow-friendly approach is:
Example: - name: Notify via PR comment
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: "Condition failed in CI"
})This avoids SMTP setup completely. 3) Best modern option → Slack / Teams / DiscordIn production CI systems, teams often prefer:
instead of email because it is faster and easier to customize. ([GitHub]3) So unfortunately:
Native emails are only workflow status notifications. For custom short messages, a marketplace mail action or chat notification integration is the practical solution. If you want minimal setup, I’d personally recommend PR comments or Slack notifications over SMTP email. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Question
💬 Feature/Topic Area
ARC (Actions Runner Controller)
Discussion Details
I simply hope to get a notification email from CI bot for certain cases:
Yet so far the simplest way to achieve such is to setting up a whole SMAP workflow in CI (with Github secrecy etc.), which seems largely overkill.
So, is there any simple ways to get a notification email (hopefully carries an user-customized short message) from a CI action?
// I understand I could update subscriptions to receive all updates on every CI, but there seems no option to customize contents of those notification emails for certain CI behavior.
Beta Was this translation helpful? Give feedback.
All reactions