Overview#
I had the opportunity to send email notifications for GitHub Actions processing results, so here are my notes.
This time we’ll use Gmail. The following was helpful as a reference.
https://stackoverflow.com/questions/69947109/sending-email-with-github-actions
Gmail Configuration#
The details are described at the following link. Enable two-factor authentication and create an app password.
https://github.com/dawidd6/action-send-mail?tab=readme-ov-file#gmail
Here is an example of app password configuration.


Local Testing#
Use act to run GitHub Actions in a local environment.
https://github.com/nektos/act
Create a file like the following in a repository.
I was able to use secrets with the following command.
So prepare a file like the following.
As a result, I was able to send emails as follows.
Verifying Failure Behavior#
For verifying failure behavior, using run: exit 1 as follows seemed to work well.
Registering Secrets#
After finishing local testing, push the changes to GitHub. At that time, I registered secrets using the GitHub CLI gh command as follows.
Summary#
While sending notifications to Slack may be more common, I hope this serves as a useful reference.