Skip to content

Commit

Permalink
chore: Fix bug in send-email action code (#1214)
Browse files Browse the repository at this point in the history
* chore: Fix bug in send-email action code

* Add run id and trigger on repo dispatch event
  • Loading branch information
lahirumaramba authored Apr 1, 2021
1 parent 1254850 commit e9e8a03
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
9 changes: 8 additions & 1 deletion .github/actions/send-email/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion .github/actions/send-email/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ function sendEmail(config) {
});

return mg.messages
.create(domain, config)
.create(config.domain, {
from: config.from,
to: config.to,
cc: config.cc,
subject: config.subject,
text: config.text,
html: config.html,
})
.then((resp) => {
core.setOutput('response', resp.message);
return;
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ name: Nightly Builds

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

jobs:
nightly:
Expand Down Expand Up @@ -75,11 +78,11 @@ jobs:
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
from: 'GitHub <admin-github@${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}>'
to: ${{ secrets.FIREBASE_ADMIN_GITHUB_EMAIL }}
subject: '[${{github.repository}}] Nightly build failed!'
subject: 'Nightly build ${{github.run_id}} of ${{github.repository}} failed!'
html: >
<b>Nightly workflow failed on: ${{github.repository}}</b>
<b>Nightly workflow ${{github.run_id}} failed on: ${{github.repository}}</b>
<br /><br />Navigate to the
<a href="https://github.com/firebase/firebase-admin-node/actions">failed workflow</a>.
<a href="https://github.com/firebase/firebase-admin-node/actions/runs/${{github.run_id}}">failed workflow</a>.
continue-on-error: true

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

0 comments on commit e9e8a03

Please sign in to comment.