-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,20 +3,27 @@ | |
| # PUSH_EMAIL_ENABLED=true (the single on/off switch). Addresses are pre-filled; | ||
| # sending needs the org SMTP secrets (SMTP_HOST/PORT/USER/PASS). Inherited by | ||
| # new repos from the template; placed on existing repos by the farm sweep. | ||
| # | ||
| # Re-landed after the 2026-07-20 notification-storm freeze (removed in | ||
| # 09f94c5), now on hyperpolymath/smtp-notify-action: Node-free, the SMTP | ||
| # session is Idris2-specified and machine-checked, the binary is Zig-built, | ||
| # byte-reproducible, and SHA-256-pinned inside the action itself. | ||
| name: Push email notification | ||
| on: | ||
| push: {} | ||
| push: | ||
| # Branch pushes only: tag and deletion payloads mislabel Branch:/head_commit. | ||
| branches: ['**'] | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| jobs: | ||
| notify: | ||
| name: Email on push | ||
| if: ${{ vars.PUSH_EMAIL_ENABLED == 'true' }} | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Send push notification email | ||
| uses: dawidd6/action-send-mail@6e502825a508b867ab2954ad6343b68787624c01 # pinned | ||
| uses: hyperpolymath/smtp-notify-action@1b3b752d39a4fe4c0f28f10905e4608789d3e050 # v0.1.0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- workflow ---'
sed -n '1,80p' .github/workflows/push-email-notify.yml
printf '%s\n' '--- pinned action metadata ---'
curl -fsSL https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/1b3b752d39a4fe4c0f28f10905e4608789d3e050/action.yml
printf '%s\n' '--- pinned repository tree (top level) ---'
curl -fsSL https://api.github.com/repos/hyperpolymath/smtp-notify-action/git/trees/1b3b752d39a4fe4c0f28f10905e4608789d3e050?recursive=1 |
jq -r '.tree[] | select(.type=="blob") | .path' | head -80Repository: hyperpolymath/docmatrix Length of output: 5792 Set the SMTP port to match the TLS mode. If 🤖 Prompt for AI Agents |
||
| with: | ||
| server_address: ${{ secrets.SMTP_HOST }} | ||
| server_port: ${{ secrets.SMTP_PORT }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Add a concurrency policy for SMTP sends.
When
PUSH_EMAIL_ENABLEDistrue, this workflow can run for every branch push, but it defines noconcurrencygroup. A burst of pushes can start multiple SMTP sends and recreate the notification storm described in the header. Add a deliberate serialisation or coalescing policy. Choose cancellation carefully because an SMTP send may already be accepted when a run is cancelled. (docs.github.com)🧰 Tools
🪛 zizmor (1.29.0)
[warning] 12-15: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents
Source: Linters/SAST tools
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,120p' .github/workflows/push-email-notify.ymlRepository: hyperpolymath/docmatrix
Length of output: 1977
🌐 Web query:
GitHub Actions push event branches filter branch deletion events github.event.deleted workflow syntax💡 Result:
In GitHub Actions, the
pushevent includes branch deletion as a triggering activity [1]. When a branch is deleted, GitHub sends apushpayload where thedeletedproperty is set totrue[1]. Because thepushevent triggers for both creations and deletions, workflows configured to run onpushwill execute when a branch is deleted unless explicitly filtered. Workflow Syntax for Filtering Standardbranchesorbranches-ignorefilters in theon.pushsection are designed to filter based on the branch name, but they do not inherently filter out the deletion event itself [2][3]. To prevent a workflow from running when a branch is deleted, you must use a conditionalifstatement at the job level [4]: jobs: my_job: if: ${{!github.event.deleted }} runs-on: ubuntu-latest steps: - run: echo "This job will not run on branch deletion." Handling Branch Deletion Events If your goal is to trigger a workflow specifically for branch deletions, you should use thedeleteevent instead ofpush[1]. Note that when using thedeleteevent, the branch has already been removed from the repository, so you cannot check out the code of the deleted branch in the same way you would during apush[5]. Example of a workflow using thedeleteevent: on: delete: jobs: on-delete: if: github.event.ref_type == 'branch' runs-on: ubuntu-latest steps: - name: Handle branch deletion run: echo "Deleted branch: ${{ github.event.ref }}" Summary of key points: - Thepushevent triggers on branch deletion (payloaddeleted: true) [1]. - Useif: ${{ !github.event.deleted }}in your job to skip workflows during deletions [4]. - Use thedeleteevent if you need to react specifically to the act of a branch being removed [1]. - Workflow filters (branches,tags) target the ref name, not the deletion status [2].Citations:
Exclude branch deletion events from the notification job.
The
pushevent includes branch deletions, andbranchesfilters do not exclude them. A deletion payload can havehead_commit: null. Add&& !github.event.deletedto the job condition.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 12-15: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents