-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #54
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. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/push-email-notify.yml
printf '%s\n' '--- pinned action contract ---'
curl -fsSL https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7/action.yml
printf '%s\n' '--- pinned implementation references ---'
for f in action.yml Dockerfile entrypoint.sh index.js src/index.js; do
url="https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7/$f"
if curl -fsSL "$url" >/tmp/action-file 2>/dev/null; then
printf '\n--- %s ---\n' "$f"
cat /tmp/action-file
fi
doneRepository: hyperpolymath/kea Length of output: 14492 Use an SMTP endpoint that supports implicit TLS and AUTH PLAIN. With 🤖 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 | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,120p' .github/workflows/push-email-notify.ymlRepository: hyperpolymath/kea
Length of output: 2998
🌐 Web query:
GitHub Actions push event branch deletion workflow runs github.event.deleted head_commit null💡 Result:
When a branch is deleted in a repository, GitHub generates a push event [1][2]. In this specific context, the push event payload indicates the deletion by setting
deletedtotrueand theafterSHA to0000000000000000000000000000000000000000[1][3]. Because the branch no longer exists at the time of the event, thehead_commitproperty in thepushevent payload is set tonull[3]. This behavior is expected, as there is no longer a valid head commit associated with the deleted reference [1][3]. If you need to handle branch deletions in GitHub Actions, you should be aware of the following: 1. Push Event Behavior: If your workflow is configured to trigger onpushevents, it may run when a branch is deleted [1][4]. Becausehead_commitis null, any attempt to access properties like${{ github.event.head_commit.message }}in your workflow will fail or return empty values, potentially causing script errors [5]. 2. Recommended Alternative: Use thedeleteevent trigger instead of relying onpushfor deletions [1][4]. Thedeleteevent is explicitly designed to trigger when a branch or tag is removed [1]. 3. Workflow Filtering: To prevent yourpushworkflows from executing on branch deletions, you can add anifcondition to your jobs [4]: if: ${{!github.event.deleted }} By using thedeleteevent, you can access the name of the deleted reference via${{ github.event.ref }}and the type (branch or tag) via${{ github.event.ref_type }}[6][4].Citations:
🌐 Web query:
site:docs.github.com/en/actions "Deleting a branch or tag will not trigger a workflow"💡 Result:
The statement that deleting a branch or tag will not trigger a workflow is incorrect. GitHub Actions supports a specific event called delete that runs a workflow when a Git reference (such as a branch or tag) is deleted from a repository [1]. To use this trigger, you must configure your workflow to listen for the delete event [1]: on: delete Important considerations for the delete event include: - The workflow file must exist on the default branch of the repository for the event to trigger [1]. - An event will not be created if more than three tags are deleted at once [1]. - When a delete event triggers a workflow, the GITHUB_SHA and GITHUB_REF environment variables are set to the last commit and the ref of the default branch, respectively [1].
Citations:
🌐 Web query:
site:docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows push event deleted branch head_commit💡 Result:
When a branch is deleted via a push event in GitHub, the head_commit field in the webhook payload is typically null [1]. In a standard push event, the payload provides details about the commit at the tip of the reference. However, since deleting a branch removes the reference, there is no longer a head commit associated with that specific branch reference in the context of the push operation. Consequently, GitHub sets the head_commit field to null in the payload to reflect that the reference no longer points to a valid commit [1]. For workflows or applications processing these events, it is important to handle this null value to avoid errors, as the operation indicates the removal of a branch rather than an update to a tip commit [1].
Citations:
Exclude branch-deletion events from the notification job.
A branch deletion can trigger this
pushworkflow withgithub.event.deleted == trueandgithub.event.head_commit == null. The job can then send an email with an emptyHead msg. Add!github.event.deletedtojobs.notify.if.🤖 Prompt for AI Agents
Source: MCP tools