-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #53
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
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,43 @@ | |
| # 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: ['**'] | ||
| concurrency: | ||
| # Deliberately per-RUN, so no run is ever queued behind another and none is | ||
| # ever cancelled. Do NOT "tidy" this into a shared group such as | ||
| # ${{ github.workflow }}-${{ github.ref }}. GitHub's workflow-syntax docs: | ||
| # "By default, any existing pending job or workflow in the same concurrency | ||
| # group will be canceled and the new queued job or workflow will take its | ||
| # place." That happens regardless of cancel-in-progress, which governs only | ||
| # the RUNNING job. On this workflow it silently loses a notification email, | ||
| # with no error anywhere. Every run here reports a DISTINCT commit, so there | ||
| # is no redundant work for a concurrency limit to remove. | ||
| # The docs also offer `queue: max` (up to 100 pending); not used, because 100 | ||
| # is still a cap whereas a per-run group needs none. | ||
| # Verified with zizmor 1.30.0: deleting this block raises concurrency-limits; | ||
| # this form silences it exactly as a shared group would. | ||
| group: push-email-${{ github.run_id }} | ||
| cancel-in-progress: false | ||
| 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@ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7 # v0.2.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 -e
printf '%s\n' '--- workflow ---'
nl -ba .github/workflows/push-email-notify.yml | sed -n '1,80p'
printf '%s\n' '--- pinned action metadata ---'
curl -fsSL https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7/action.yml
printf '%s\n' '--- pinned action source references ---'
curl -fsSL https://api.github.com/repos/hyperpolymath/smtp-notify-action/commits/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7 \
| jq -r '.sha, (.files[]?.filename)'Repository: hyperpolymath/formatrix-docs Length of output: 5859 🤖 get_repo_knowledge executed:
Length of output: 5528 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- workflow ---'
sed -n '1,80p' .github/workflows/push-email-notify.yml
printf '%s\n' '--- pinned action documentation and implementation references ---'
for path in README.md CHANGELOG.adoc; do
printf '%s\n' "--- ${path} ---"
curl -fsSL "https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7/${path}" \
| grep -n -E -C 3 'secure|STARTTLS|465|587|server_port' || true
doneRepository: hyperpolymath/formatrix-docs Length of output: 4581 Verify the configured SMTP port before enabling notifications. If 🤖 Prompt for AI AgentsSource: MCP tools |
||
| 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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,120p' .github/workflows/push-email-notify.ymlRepository: hyperpolymath/formatrix-docs
Length of output: 3009
🤖 get_repo_knowledge executed:
get_repo_knowledge hyperpolymath/formatrix-docs /tmp/coderabbit-repo-knowledge/hyperpolymath-formatrix-docs-ffc998dd/architectureLength of output: 5528
🏁 Script executed:
Repository: hyperpolymath/formatrix-docs
Length of output: 202
🏁 Script executed:
Repository: hyperpolymath/formatrix-docs
Length of output: 219
🌐 Web query:
GitHub Actions push event branch deletion github.event.deleted head_commit nullable workflow💡 Result:
In GitHub Actions, when a
pushevent is triggered by a branch deletion, thehead_commitproperty in thegithub.eventpayload is indeednull[1]. This occurs because a push event is technically sent to GitHub's webhook system when a branch is deleted (with theafterSHA set to a null SHA,0000000000000000000000000000000000000000) [1]. Since no commit is being "pushed" in the traditional sense, there is no associatedhead_commitobject [1]. To handle this in your workflows: 1. Check for deletion: You can explicitly check if the push event represents a deletion by checking thedeletedboolean in the payload:${{ github.event.deleted }}2. Safe access: If you need to access properties ofhead_commit, ensure the event is not a deletion first to avoid errors, or use conditional logic:if: ${{ !github.event.deleted }}run: echo "${{ github.event.head_commit.message }}"If you specifically need to trigger workflows only on branch or tag deletions, thedeleteevent is the recommended alternative to thepushevent [2][3][4]. Thedeleteevent payload provides therefandref_type(branch or tag), but does not contain commit information [5].Citations:
🌐 Web query:
site:docs.github.com actions workflow syntax branches filter push branch deletion event💡 Result:
In GitHub Actions, the push event includes branch deletion events [1][2][3]. When a branch is deleted, it is considered a push event with a specific state (the SHA typically reverts to the repository's default branch) [2][3]. Because branch deletion triggers the push event, any branches filter configured in your workflow will be evaluated against the deleted branch's name [4][5]. If the name of the deleted branch matches your specified branches or patterns, the workflow will trigger [6][7]. If you need to handle branch deletions separately or specifically exclude them from triggering your workflows, you may need to: 1. Use a filter with the! (negation) operator if you want to exclude specific patterns, though this can be complex when managing inclusion and exclusion [4][7]. 2. Use the dedicated delete event instead of the push event if your workflow's primary goal is to respond specifically to deletions, as this provides a separate trigger context [2][3]. Note that the delete event only triggers if the workflow file exists on the default branch [2]. 3. Add a step at the beginning of your job to inspect the event payload (e.g., checking if the ref was deleted) and exit early if the action is not desired [1]. The push event payload includes a boolean field deleted to indicate whether the ref was deleted [1].
Citations:
Exclude branch-deletion events from the notification job.
When
PUSH_EMAIL_ENABLED == 'true',branches: ['**']also permits branch-deletionpushevents. These events can havegithub.event.head_commit == null, sogithub.event.head_commit.messagecan produce an incomplete email body. Add&& !github.event.deletedto the job condition, or add an equivalent deletion guard.🤖 Prompt for AI Agents
Source: MCP tools