Reusable GitHub Action
for sending a commit email with the git diff everytime someone pushes to a branch.
GitHub provides commit emails for PRs only, but those don't include the diff.
This assumes a
GitHub secret
called MAILBOT_PASSWORD with the SMTP password for [email protected].
It doesn't run on commits from dependabot[bot] since those
don't have secret access, resulting in a mailbot error.
TODO
Find out how to get rid of "---" in git show output.
Document how to use this.
Add email screenshots.
Document code.
Add tests for the parts of the pipeline that are testable.
Explain why we used reusable workflow vs. composable workflow.
Cache at least specific versions of the brew pkgs.
Delta removes color in the git show header.
Maybe we can only pipe the diff part to delta.
Set email time to the commit time.
Document testing process.
E2E testing on forked mailbot can use mailbot_repo flag.
Document looking at GH action output log to see GH env json, which is
passed to Go mailbot script and contains information that can be useful
for debugging mailbot behavior and adding features.
Don't run the mailbot workflow unless it can access the secret.
E.g., dependabot PRs can't access the secret, so either they need
to be given access, or the workflow should not run.