-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #19
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,19 +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: | ||
| 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 | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workflow context ---'
cat -n .github/workflows/push-email-notify.yml | sed -n '30,50p'
printf '%s\n' '--- repository references to the action ---'
rg -n -C 2 'hyperpolymath/smtp-notify-action|1b3b752d39a4fe4c0f28f10905e4608789d3e050|ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7' .github README.md 2>/dev/null || true
printf '%s\n' '--- tag and commit resolution ---'
if command -v gh >/dev/null 2>&1; then
for tag in v0.1.0 v0.2.0; do
echo "TAG $tag"
gh api "repos/hyperpolymath/smtp-notify-action/git/ref/tags/$tag" --jq '.object | "\(.type) \(.sha)"' || true
done
for sha in 1b3b752d39a4fe4c0f28f10905e4608789d3e050 ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7; do
echo "COMMIT $sha"
gh api "repos/hyperpolymath/smtp-notify-action/commits/$sha" --jq '.sha' || true
done
else
echo 'gh unavailable'
fiRepository: hyperpolymath/ddraig-ssg Length of output: 2373 🏁 Script executed: #!/bin/bash
set -u
repo=hyperpolymath/smtp-notify-action
for pair in \
'v0.1.0 1fb433a0048cf21f40499d54b1bd236ad52b6bc9' \
'v0.2.0 e5e4b8d9978e34b40712361a825855e7be466160'
do
set -- $pair
tag=$1
object=$2
echo "--- $tag tag object ---"
gh api "repos/$repo/git/tags/$object" --jq '.object | "\(.type) \(.sha)"'
commit=$(gh api "repos/$repo/git/tags/$object" --jq '.object.sha')
echo "--- $tag commit validation ---"
gh api "repos/$repo/commits/$commit" --jq '.sha'
echo "--- $tag action metadata ---"
gh api "repos/$repo/contents/action.yml?ref=$commit" --jq '.content' | base64 -d
echo
doneRepository: hyperpolymath/ddraig-ssg Length of output: 9690 Pin the release required by the PR objective. If v0.1.0 is required, replace the v0.2.0 pin. The releases have different input contracts and behaviour. 🤖 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.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: hyperpolymath/ddraig-ssg
Length of output: 2866
🌐 Web query:
GitHub Actions concurrency workflow runs default behaviour jobs run concurrently official documentation💡 Result:
The default behavior of GitHub Actions is to allow multiple jobs within the same workflow, multiple workflow runs within the same repository, and multiple workflow runs across a repository owner's account to run concurrently [1][2]. By default, there are no restrictions on concurrent execution, meaning multiple instances of the same workflow or job can execute simultaneously [1][2]. To restrict this behavior, you must explicitly use the
concurrencykeyword in your workflow configuration [1][3]. When you define aconcurrencykey with a specified group name, GitHub Actions ensures that only a single job or workflow run using that concurrency group executes at any given time [4][3][5]. When concurrency is restricted via theconcurrencykeyword, the default behavior for handling queued runs within that group is as follows: - When a new job or workflow is queued and another is already in progress within the same group, the new run is marked aspending[4][3]. - By default, if anotherpendingrun already exists in the group, it is canceled and replaced by the newly queued run [4][3][5]. - You can optionally configure the behavior to queue multiple runs instead of canceling them by settingcancel-in-progress: false(to allow queuing) or by configuring the queue limits, such as usingmax(which allows up to 100 runs to be queued before additional runs are canceled) [4][3].Citations:
Add an explicit delivery policy for push bursts.
This workflow starts one SMTP job for each enabled branch push. GitHub Actions permits these runs to execute concurrently unless a
concurrencypolicy limits them. A push burst can therefore send notifications out of order or exceed SMTP service limits.timeout-minuteslimits each run duration; it does not limit concurrency.Add a queue or rate-limit policy that retains every required notification. Do not use
cancel-in-progress: truewhen every push must produce an email.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 12-15: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents
Sources: MCP tools, Linters/SAST tools
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,120p' .github/workflows/push-email-notify.ymlRepository: hyperpolymath/ddraig-ssg
Length of output: 1978
🌐 Web query:
GitHub Actions push webhook payload deleted branch deletion github.event.deleted💡 Result:
In GitHub Actions, you should use the
deleteevent to handle branch deletions, rather than relying on thepushevent [1][2]. Key technical details regarding this process: 1. Workflow Configuration: To trigger a workflow on branch deletion, you must explicitly add thedeleteevent to your workflow file [1][2]. Crucially, this workflow file must exist on the repository's default branch for the event to trigger [2][3]. 2. Accessing Deleted Branch Name: When thedeleteevent triggers a workflow, the standardGITHUB_REFenvironment variable will point to the default branch, not the branch that was deleted [1]. To identify the deleted branch, you must use thegithub.event.refproperty from the workflow context [4][1]. 3. Filtering Events: Because thedeleteevent triggers for both branch and tag deletions, you should filter for branches using thegithub.event.ref_typeproperty within your job'sifcondition [1]: jobs: cleanup: runs-on: ubuntu-latest if: github.event.ref_type == 'branch' steps: - name: Clean up run: echo "The deleted branch was ${{ github.event.ref }}" Regarding thepushevent, while the underlying GitHub webhook forpushtechnically includes information about branch deletions in its payload (wheredeletedistrue) [5][6], the GitHub Actionspushtrigger is generally not used for handling deletions. If you attempt to use it, standard branch filtering in your workflow will often prevent it from running because the target reference no longer exists or the environment defaults to the repository's default branch [7][8]. Use the dedicateddeleteevent for reliable results [1].Citations:
🌐 Web query:
site:docs.github.com GitHub Actions push event branch deletion branches filter deleted true workflow💡 Result:
In GitHub Actions, the
pushevent includes branch deletions [1][2]. While there is no dedicated "deleted" filter in theon.pushconfiguration syntax to directly trigger a workflow based on branch deletion, you can determine if a branch was deleted by checking the event payload within your workflow [1][3][2]. Thepushevent payload contains a boolean field calleddeleted[1][2]. You can access this in your workflow using thegithub.eventcontext [3]. To run a workflow job only when a branch is deleted, use anifcondition: jobs: my_job: runs-on: ubuntu-latest if: ${{ github.event.deleted == true }} steps: - name: Handle branch deletion run: echo "The branch ${{ github.ref }} was deleted." Theon.pushfilter syntax (such asbranchesandbranches-ignore) is designed to control which branches trigger the workflow, but it does not support filtering by thedeletedstatus of the push [4][5][6]. Consequently, the workflow will still be triggered by the push event itself, and theifcondition will then determine whether the job should proceed based on thedeletedstatus [3]. If you only want to react to branch or tag deletions and do not need to process standard push events, you may consider using thedeletewebhook event instead, though note thatdeleteevents function differently and are notpushevents [1][2]. Top results: [1][3][2]Citations:
Skip deleted branch events explicitly.
branches: ['**']does not filter thedeletedfield of apushevent. Without this guard, the enabled job can send an email for a deleted branch. Add!github.event.deletedto the job condition.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 12-15: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents
Source: MCP tools