GitHub Actionsのボットからの通知メールをフィルタリングするためのSieve
#Sieve #メール #GitHub_Actions
GitHub Actionsのボットがリポジトリのissueなどにコメントするとメールが届くので以下でフィルタリングしている。
code:sieve
/* Move to "GitHub Actions Bot" */
/* NOTE: Currently comment notification email from nwtgck/actions-netlify is noisy. I'd like to check the body of mails, but require "body"; could not be done in ProtonMail. */
if header :is "X-Github-Sender" "github-actionsbot" {
fileinto "GitHub Actions Bot";
}
コードの説明
GitHubからの自動メールは拡張メールヘッダとしてX-Github-Senderがついていて、ここにgithub-actions[bot]が入ることを利用している。本当はactions-netlifyからのコメントだけに限定して影響範囲を狭くしたフィルタリングをしたいが、ProtonMailは暗号化を意識して作られているせいかrequire ["body"]; は機能しない。そのためGitHub Actionsのボットからの通知のメールを全部特定のフォルダに入れるようにした。