-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #48
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@0bbdab096651ee93f37ec02383e088183d41ff0b # 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 | 🔵 Trivial 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/push-email-notify.yml | sed -n '1,90p'
printf '%s\n' '--- repository references ---'
rg -n -S --hidden --glob '!node_modules' --glob '!dist' --glob '!build' \
'hyperpolymath/smtp-notify-action|smtp-server|SMTP_|secure:|AUTH LOGIN|STARTTLS|Microsoft 365|smtp\.office365' .Repository: hyperpolymath/vext Length of output: 4365 🌐 Web query:
💡 Result: There is no specific software or GitHub Action named "smtp-notify-action" published by the organization or user "hyperpolymath" [1][2][3]. The "hyperpolymath" organization uses a standard email notification workflow in its repositories (often titled Citations:
🏁 Script executed: #!/bin/bash
set -eu
repo='hyperpolymath/smtp-notify-action'
pin='ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7'
printf '%s\n' '--- pinned commit ---'
curl -fsSL "https://github.com/ghapi/repos/${repo}/commits/${pin}" |
jq '{sha: .sha, message: .commit.message}'
printf '%s\n' '--- v0.2.0 ref ---'
curl -fsSL "https://github.com/ghapi/repos/${repo}/git/refs/tags/v0.2.0" |
jq '{ref: .ref, type: .object.type, sha: .object.sha}'
printf '%s\n' '--- action metadata at pinned commit ---'
curl -fsSL "https://github.com/ghraw/${repo}/${pin}/action.yml"
printf '%s\n' '--- implementation file listing at pinned commit ---'
curl -fsSL "https://github.com/ghapi/repos/${repo}/git/trees/${pin}?recursive=1" |
jq -r '.tree[] | select(.type == "blob") | .path' |
grep -E '(^|/)(action\.yml|action\.yaml|README|src|main|smtp|notify|package\.json)' | head -80Repository: hyperpolymath/vext Length of output: 7557 🏁 Script executed: #!/bin/bash
set -eu
repo='hyperpolymath/smtp-notify-action'
pin='ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7'
printf '%s\n' '--- dereferenced v0.2.0 tag ---'
tag_object="$(
curl -fsSL "https://github.com/ghapi/repos/${repo}/git/refs/tags/v0.2.0" |
jq -r '.object | [.type, .sha] | `@tsv`'
)"
printf '%s\n' "$tag_object"
tag_type="${tag_object%%$'\t'*}"
tag_sha="${tag_object#*$'\t'}"
if [ "$tag_type" = tag ]; then
curl -fsSL "https://github.com/ghapi/repos/${repo}/git/tags/${tag_sha}" |
jq '{type: .object.type, commit_sha: .object.sha}'
else
printf '%s\n' "{\"type\":\"${tag_type}\",\"commit_sha\":\"${tag_sha}\"}"
fi
printf '%s\n' '--- transport/auth implementation ---'
for path in src/smtp.zig src/main.zig; do
printf '%s\n' "--- ${path} ---"
curl -fsSL "https://github.com/ghraw/${repo}/${pin}/${path}" |
nl -ba |
grep -Ei -C 8 'STARTTLS|AUTH|implicit|secure|SMTP_SECURE|TLS|unsupported|not implemented'
doneRepository: hyperpolymath/vext Length of output: 486 Verify SMTP compatibility before enabling this workflow.
🤖 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/vext
Length of output: 3437
🌐 Web query:
GitHub Actions push event branches filter deleted branch deleted true head_commit null💡 Result:
In GitHub Actions, the push event is triggered not only by new commits but also when a branch or tag is deleted [1][2]. When a branch is deleted, the event payload includes a
deletedfield set totrue, and thehead_commitobject is typicallynull[3][4]. Because thepushevent fires on deletions, you may encounter workflows running unexpectedly when branches are removed. You can manage this behavior using the following strategies: 1. Filter at the Workflow Level: You can use a conditional check in theiffield of your job to skip execution when a branch deletion occurs: if: ${{!github.event.deleted }} 2. Distinguish Between Push and Delete Events: If you specifically need to handle branch deletions, it is recommended to use thedeleteevent instead of thepushevent [5][2]. Thedeleteevent allows you to specifically filter for branch deletions and access details about the deleted ref [5]. Example of handling deletion specifically: on: delete: push: branches: - 'main' jobs: handle-delete: if: github.event_name == 'delete' && github.event.ref_type == 'branch' runs-on: ubuntu-latest steps: - name: Handle branch deletion run: echo "The branch ${{ github.event.ref }} was deleted." Note that when a branch is deleted, theGITHUB_REFin apushworkflow context may revert to the repository's default branch, and theGITHUB_SHAwill correspond to the last commit on that default branch [6][7]. Always rely on the event payload (e.g.,github.event.ref) when handling these events to ensure you are referencing the correct target [5].Citations:
🌐 Web query:
site:docs.github.com webhook push event deleted branch head_commit null💡 Result:
When a branch is deleted in a GitHub repository, the push webhook event is triggered [1][2]. In the resulting payload, the head_commit field is set to null because there is no longer a valid commit head associated with the deleted reference [1][3][4]. The push event payload includes several fields that indicate the state of the reference: - deleted: This boolean field is set to true when a branch or tag is deleted [1][2]. - head_commit: This field, which typically contains information about the latest commit on the ref, is set to null in the context of a deletion [1][4]. - ref: This field contains the full Git reference that was deleted (e.g., refs/heads/branch-name) [1][5]. Because the push event encompasses various activities—including branch deletions, tag deletions, and code pushes—the payload structure is designed to handle these different scenarios by allowing head_commit to be null when no specific commit is being "pushed" to an active branch [1][6]. If you only need to react to branch or tag deletions, you can alternatively subscribe to the delete webhook event [1][2].
Citations:
🌐 Web query:
site:docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows push branches filters deleted ref💡 Result:
In the context of GitHub Actions, the push event is specifically triggered by updates to references, such as creating a new branch or pushing commits [1]. When a branch is deleted, this does not trigger the push event [1]. Instead, deleting a Git reference (such as a branch or tag) triggers the delete event [1]. Therefore, you cannot use branch filters (like branches or branches-ignore) on a push event to selectively run workflows during a deletion process, as the push event itself does not handle deletions [1]. If you need to perform actions when a branch is deleted, you should use the delete event [1]. You can configure a workflow to run specifically when a branch or tag is deleted using the following syntax in your workflow file: on: delete: Within the delete event, the workflow does not support branch-specific filters in the same way as the push event; however, you can add conditional logic within your job steps to check the deleted reference using the GITHUB_REF environment variable or the github context [1].
Citations:
🏁 Script executed:
Repository: hyperpolymath/vext
Length of output: 5039
🏁 Script executed:
Repository: hyperpolymath/vext
Length of output: 13767
Exclude deleted branch pushes from this job.
When a deleted branch matches
branches: ['**'],github.event.deletedistrueandgithub.event.head_commitmay benull. IfPUSH_EMAIL_ENABLEDistrue, thenotifyjob can send a misleading email for the deletion. Add!github.event.deletedto the job condition.Proposed guard
🤖 Prompt for AI Agents
Source: MCP tools