-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #9
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,19 +4,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: | ||||||
| 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@v18 | ||||||
| uses: hyperpolymath/smtp-notify-action@v0.2.0 # NOSONAR — pin authority is actions.lock (sha1-ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7) | ||||||
|
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. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
: "${SMTP_PORT:?Set SMTP_PORT to the configured repository secret value}"
test "$SMTP_PORT" = "465"Repository: hyperpolymath/JuliaForChildren.jl Length of output: 252 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- workflow ---'
sed -n '32,52p' .github/workflows/push-email-notify.yml
printf '%s\n' '--- action.yml at v0.2.0 ---'
curl -fsSL https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/v0.2.0/action.yml
printf '%s\n' '--- action implementation references ---'
curl -fsSL https://api.github.com/repos/hyperpolymath/smtp-notify-action/git/trees/v0.2.0?recursive=1 |
jq -r '.tree[].path' |
grep -E '(^|/)(action\.yml|src/|.*\.(js|ts|go|rs|py))$' |
head -80Repository: hyperpolymath/JuliaForChildren.jl Length of output: 6608 Use an implicit-TLS SMTP endpoint. Because 🤖 Prompt for AI AgentsSource: MCP tools 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
workflow=".github/workflows/push-email-notify.yml"
lock=".github/workflows/actions.lock"
expected="ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7"
ref="$(sed -n 's/.*uses: hyperpolymath\/smtp-notify-action@\([^ #]*\).*/\1/p' "$workflow")"
test "$ref" = "$expected"
grep -Fq "commit: 'sha1-$expected'" "$lock"Repository: hyperpolymath/JuliaForChildren.jl Length of output: 171 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- workflow ---'
sed -n '36,48p' .github/workflows/push-email-notify.yml
printf '%s\n' '--- lock entry ---'
rg -n -C 3 'hyperpolymath/smtp-notify-action|ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7' .github/workflows/actions.lockRepository: hyperpolymath/JuliaForChildren.jl Length of output: 1415 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
repo='hyperpolymath/smtp-notify-action'
tag='v0.2.0'
sha='ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7'
printf '%s\n' '--- tag reference ---'
curl -fsSL "https://api.github.com/repos/$repo/git/refs/tags/$tag" |
jq '{object_type: .object.type, object_sha: .object.sha}'
printf '%s\n' '--- dereferenced tag ---'
curl -fsSL "https://api.github.com/repos/$repo/commits/$tag" |
jq '{resolved_sha: .sha, message: .commit.message}'
printf '%s\n' '--- locked commit ---'
curl -fsSL "https://api.github.com/repos/$repo/commits/$sha" |
jq '{resolved_sha: .sha, message: .commit.message}'Repository: hyperpolymath/JuliaForChildren.jl Length of output: 3425 Pin the action reference to the locked commit.
- uses: hyperpolymath/smtp-notify-action@v0.2.0 # NOSONAR — pin authority is actions.lock (sha1-ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7)
+ uses: hyperpolymath/smtp-notify-action@ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7 # v0.2.0📝 Committable suggestion
Suggested change
🤖 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:
Repository: hyperpolymath/JuliaForChildren.jl
Length of output: 13791
🌐 Web query:
GitHub Actions push event branch filters branch deletion events deleted true head_commit null official documentation💡 Result:
In GitHub Actions, the push event payload includes a boolean field named "deleted" [1][2][3][4]. When a branch is deleted, GitHub triggers a push event where this "deleted" field is set to true and the "head_commit" field is null [1][2][5]. Although the push event technically triggers during a branch deletion, attempting to filter this specifically using the standard "branches" filter in a workflow YAML file is often unreliable or ineffective because the "push" event context at that moment reverts to the default branch [6][7][8]. To handle branch deletions effectively, the official recommendation is to use the dedicated "delete" event trigger instead of relying on the "push" event [1][2][7][8]. Key details: - The "delete" event occurs specifically when a Git branch or tag is removed [1][7][8]. - You can filter for branch deletions specifically by checking the event context: if: github.event.ref_type == 'branch' [9][10] - The deleted branch name is available in the "delete" event payload via
${{ github.event.ref }}[11][9]. - Unlike the push event, which reverts to the default branch context during deletion, the delete event is designed to handle this specific action [6][11][7][9].Citations:
Exclude branch deletion events explicitly.
A branch deletion can trigger this
pushworkflow withgithub.event.deleted == trueandgithub.event.head_commit == null. The current job condition therefore reaches the notification action without a commit message.🤖 Prompt for AI Agents
Source: MCP tools