-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #108
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 |
|---|---|---|
| @@ -1,23 +1,46 @@ | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
| # This workflow is managed by gh actions-lock. | ||
| # This workflow is managed by gh actions-lock. | ||
| # Dormant push-email notification. ARMED by setting the repo variable | ||
| # 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@v3.12.0 | ||
| 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. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- workflow ---'
sed -n '30,52p' .github/workflows/push-email-notify.yml
printf '%s\n' '--- lock entry ---'
rg -n -C 2 'hyperpolymath/smtp-notify-action|SMTP_PORT|secure' .github/workflows/actions.lock .github/workflows/push-email-notify.yml
printf '%s\n' '--- repository references ---'
rg -n -C 2 'SMTP_PORT|smtp-notify-action|secure:' .github README.md 2>/dev/null || trueRepository: hyperpolymath/betlang Length of output: 5321 🏁 Script executed: set -eu
base='https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7'
for file in action.yml src/index.ts src/main.ts src/smtp.ts index.ts main.ts; do
url="$base/$file"
body=$(curl -fsSL "$url" 2>/dev/null || true)
if [ -n "$body" ]; then
printf '%s\n' "--- $file ---"
printf '%s\n' "$body" | sed -n '1,240p'
fi
doneRepository: hyperpolymath/betlang Length of output: 5671 Use an implicit-TLS-compatible SMTP port.
🤖 Prompt for AI AgentsSource: MCP tools 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- workflow ---'
sed -n '35,50p' .github/workflows/push-email-notify.yml
printf '%s\n' '--- lock entry ---'
rg -n -C 3 'smtp-notify-action|hyperpolymath' .github/workflows/actions.lock
printf '%s\n' '--- repository references ---'
rg -n -C 2 'v0\.1\.0|v0\.2\.0|1b3b752d39a4fe4c0f28f10905e4608789d3e050|ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7|smtp-notify-action' .github README.md . 2>/dev/null | head -200
printf '%s\n' '--- action contracts ---'
for ref in 1b3b752d39a4fe4c0f28f10905e4608789d3e050 ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7; do
printf '\n### %s\n' "$ref"
curl -fsSL --max-time 15 "https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/$ref/action.yml" || true
done
printf '%s\n' '--- tag resolution ---'
for tag in v0.1.0 v0.2.0; do
printf '\n### %s\n' "$tag"
curl -fsSL --max-time 15 "https://api.github.com/repos/hyperpolymath/smtp-notify-action/git/ref/tags/$tag" | jq '{ref, object}' || true
doneRepository: hyperpolymath/betlang Length of output: 16429 🏁 Script executed: for tag_obj in 1fb433a0048cf21f40499d54b1bd236ad52b6bc9 e5e4b8d9978e34b40712361a825855e7be466160; do
printf '\n--- annotated tag %s ---\n' "$tag_obj"
curl -fsSL --max-time 15 "https://api.github.com/repos/hyperpolymath/smtp-notify-action/git/tags/$tag_obj" |
jq '{object, tag}'
done
for sha in 1b3b752d39a4fe4c0f28f10905e4608789d3e050 ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7; do
printf '\n--- commit %s ---\n' "$sha"
curl -fsSL --max-time 15 "https://api.github.com/repos/hyperpolymath/smtp-notify-action/commits/$sha" |
jq '{sha: .sha, message: .commit.message}'
doneRepository: hyperpolymath/betlang Length of output: 3386 Align the SMTP action release with the approved release. 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 | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: hyperpolymath/betlang
Length of output: 10114
🌐 Web query:
GitHub Actions push event branch deletion branches filter github.event.deleted head_commit null official documentation💡 Result:
When a branch is deleted, the push event is triggered in GitHub Actions [1][2]. In this scenario, the head_commit object in the push event payload is null because there is no tip commit associated with a deleted reference [2]. To detect or filter these events in your workflow, you can use the following approaches: 1. Detecting branch deletions: If you specifically need to respond to a branch deletion, use the delete event rather than the push event [2]. The delete event payload provides the necessary information about the deleted reference (the branch name) [1][2]. 2. Filtering deleted branches from push workflows: If you want to prevent a workflow (triggered by push) from running when a branch is deleted, you can add a conditional check to your job's if filter [1]. Because the push event sets the deleted property to true when a branch is removed, you can exclude these events [2]: jobs: your_job: if: ${{!github.event.deleted }} runs-on: ubuntu-latest steps: - name: Process push run: echo "Not a deletion" 3. Limitations of push filters: The standard push event filters, such as branches or branches-ignore, do not inherently filter out branch deletion events [3][4]. Because a branch deletion triggers a push event, the workflow may still attempt to run unless you explicitly check the github.event.deleted property in your job conditional [1]. Summary of Key Payload Fields (Push Event): - github.event.deleted: A boolean indicating if the push event was caused by a branch/tag deletion [2]. - github.event.head_commit: This will be null when a branch is deleted, as there is no longer a head commit for that reference [2].
Citations:
Exclude deleted branch refs explicitly.
When a branch is deleted, GitHub emits a
pushevent withgithub.event.deleted == trueandgithub.event.head_commit == null. Thebranches: ['**']filter can match the deleted branch ref. When notifications are enabled, this job can therefore process a deletion payload and build an invalid notification.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 13-16: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents
Source: MCP tools