Skip to content

Commit e9e8a03

Browse files
chore: Fix bug in send-email action code (#1214)
* chore: Fix bug in send-email action code * Add run id and trigger on repo dispatch event
1 parent 1254850 commit e9e8a03

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

.github/actions/send-email/dist/index.js

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/send-email/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ function sendEmail(config) {
5656
});
5757

5858
return mg.messages
59-
.create(domain, config)
59+
.create(config.domain, {
60+
from: config.from,
61+
to: config.to,
62+
cc: config.cc,
63+
subject: config.subject,
64+
text: config.text,
65+
html: config.html,
66+
})
6067
.then((resp) => {
6168
core.setOutput('response', resp.message);
6269
return;

.github/workflows/nightly.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ name: Nightly Builds
1616

1717
on:
1818
# Runs every day at 06:00 AM (PT) and 08:00 PM (PT) / 04:00 AM (UTC) and 02:00 PM (UTC)
19+
# or on 'firebase_build' repository dispatch event.
1920
schedule:
2021
- cron: "0 4,14 * * *"
22+
repository_dispatch:
23+
types: [firebase_build]
2124

2225
jobs:
2326
nightly:
@@ -75,11 +78,11 @@ jobs:
7578
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
7679
from: 'GitHub <admin-github@${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}>'
7780
to: ${{ secrets.FIREBASE_ADMIN_GITHUB_EMAIL }}
78-
subject: '[${{github.repository}}] Nightly build failed!'
81+
subject: 'Nightly build ${{github.run_id}} of ${{github.repository}} failed!'
7982
html: >
80-
<b>Nightly workflow failed on: ${{github.repository}}</b>
83+
<b>Nightly workflow ${{github.run_id}} failed on: ${{github.repository}}</b>
8184
<br /><br />Navigate to the
82-
<a href="https://github.com/firebase/firebase-admin-node/actions">failed workflow</a>.
85+
<a href="https://github.com/firebase/firebase-admin-node/actions/runs/${{github.run_id}}">failed workflow</a>.
8386
continue-on-error: true
8487

8588
- name: Send email on cancelled
@@ -90,9 +93,9 @@ jobs:
9093
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
9194
from: 'GitHub <admin-github@${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}>'
9295
to: ${{ secrets.FIREBASE_ADMIN_GITHUB_EMAIL }}
93-
subject: '[${{github.repository}}] Nightly build got cancelled!'
96+
subject: 'Nightly build ${{github.run_id}} of ${{github.repository}} cancelled!'
9497
html: >
95-
<b>Nightly workflow cancelled on: ${{github.repository}}</b>
98+
<b>Nightly workflow ${{github.run_id}} cancelled on: ${{github.repository}}</b>
9699
<br /><br />Navigate to the
97-
<a href="https://github.com/firebase/firebase-admin-node/actions">cancelled workflow</a>.
100+
<a href="https://github.com/firebase/firebase-admin-node/actions/runs/${{github.run_id}}">cancelled workflow</a>.
98101
continue-on-error: true

0 commit comments

Comments
 (0)