-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #72
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@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. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- workflow ---'
sed -n '35,47p' .github/workflows/push-email-notify.yml
printf '%s\n' '--- actions.lock ---'
rg -n -C 2 'smtp-notify-action|ede1191|v0\.2\.0' .github/workflows/actions.lock
printf '%s\n' '--- tag ref ---'
ref="$(curl -fsSL 'https://github.com/ghapi/repos/hyperpolymath/smtp-notify-action/git/ref/tags/v0.2.0')"
printf '%s\n' "$ref" | jq '{ref, object}'
type="$(printf '%s' "$ref" | jq -r '.object.type')"
sha="$(printf '%s' "$ref" | jq -r '.object.sha')"
if [ "$type" = tag ]; then
printf '%s\n' '--- annotated tag target ---'
curl -fsSL "https://github.com/ghapi/repos/hyperpolymath/smtp-notify-action/git/tags/$sha" |
jq '{object}'
sha="$(curl -fsSL "https://github.com/ghapi/repos/hyperpolymath/smtp-notify-action/git/tags/$sha" |
jq -r '.object.sha')"
fi
printf '%s\n' '--- resolved commit ---'
curl -fsSL "https://github.com/ghapi/repos/hyperpolymath/smtp-notify-action/commits/$sha" |
jq '{sha, html_url}'Repository: hyperpolymath/idrisiser Length of output: 1889 Pin the action reference to the locked commit.
🤖 Prompt for AI AgentsSource: MCP tools 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/push-email-notify.yml
printf '%s\n' '--- relevant lock entry ---'
if [ -f .github/actions.lock ]; then
rg -n -C 3 'hyperpolymath/smtp-notify-action|ede1191|smtp-notify' .github/actions.lock
else
find .github -maxdepth 2 -type f -iname '*lock*' -print
rg -n -C 3 'hyperpolymath/smtp-notify-action|ede1191|smtp-notify' .github
fi
printf '%s\n' '--- action contract ---'
curl -fsSL https://github.com/ghraw/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7/action.yml
printf '%s\n' '--- transport implementation references ---'
curl -fsSL https://github.com/ghapi/repos/hyperpolymath/smtp-notify-action/git/trees/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7?recursive=1 |
jq -r '.tree[] | select(.type=="blob" and (.path|test("(^|/)(package.json|.*\\.(js|ts|mjs|cjs))$"))) | .path'Repository: hyperpolymath/idrisiser Length of output: 11674 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/push-email-notify.yml
printf '%s\n' '--- relevant lock entry ---'
if [ -f .github/actions.lock ]; then
rg -n -C 3 'hyperpolymath/smtp-notify-action|ede1191|smtp-notify' .github/actions.lock
else
find .github -maxdepth 2 -type f -iname '*lock*' -print
rg -n -C 3 'hyperpolymath/smtp-notify-action|ede1191|smtp-notify' .github
fi
printf '%s\n' '--- action contract ---'
curl -fsSL https://github.com/ghraw/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7/action.yml
printf '%s\n' '--- transport implementation references ---'
curl -fsSL 'https://github.com/ghapi/repos/hyperpolymath/smtp-notify-action/git/trees/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7?recursive=1' |
jq -r '.tree[] | select(.type=="blob" and (.path|test("(^|/)(package.json|.*\\.(js|ts|mjs|cjs))$"))) | .path'Repository: hyperpolymath/idrisiser Length of output: 11674 Verify the SMTP transport. 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/idrisiser
Length of output: 7742
🌐 Web query:
site:docs.github.com GitHub Actions push event branch deletion head_commit null branches filter💡 Result:
When a branch is deleted in a GitHub repository, the push event is triggered [1][2]. In the corresponding webhook payload, the head_commit field is null [1][2]. This occurs because there is no head commit associated with a branch that has been removed [1][2]. If you are using branch filters in your GitHub Actions workflow (e.g., on: push: branches: [...]), the behavior is as follows: 1. Workflow Filtering: GitHub Actions evaluates the push event against your defined branch filters [3][4]. If the deleted branch name matches a branch filter you have defined, the workflow will trigger [5][6]. 2. Handling null head_commit: Because the event triggers for the deletion, your workflow might attempt to access commit information. If your workflow relies on GitHub context variables like github.event.head_commit (which maps to the webhook's head_commit field), it will receive a null value, potentially causing your workflow jobs to fail if they are not written to handle this gracefully [1][2]. To prevent workflows from running on branch deletions, you can use the delete event instead of the push event if you only care about deletions, or you can implement a conditional check within your workflow steps to skip logic if the head_commit is null or if the ref was deleted [1][7]. The webhook payload includes a boolean field deleted, which is set to true when a branch is removed, allowing you to explicitly check this state in your workflow steps [1][2].
Citations:
Exclude branch-deletion pushes.
branches: ['**']does not exclude branch-deletionpushevents. When enabled, this job can send a notification with no commit message becausegithub.event.head_commitisnull.Add
!github.event.deletedto the job condition.🤖 Prompt for AI Agents
Source: MCP tools