-
-
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 |
|---|---|---|
|
|
@@ -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. 🩺 Stability & Availability | 🟡 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 | sed -n '1,90p'
printf '%s\n' '--- action contract at pinned commit ---'
curl -fsSL https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7/action.yml | nl -ba
printf '%s\n' '--- implementation files referenced by action metadata ---'
curl -fsSL https://api.github.com/repos/hyperpolymath/smtp-notify-action/contents?ref=ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7 |
jq -r '.[].name' | head -80Repository: hyperpolymath/thejeffparadox Length of output: 3579 🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- action.yml at pinned commit ---'
curl -fsSL https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7/action.yml |
sed -n '1,220p'
printf '%s\n' '--- repository tree at pinned commit ---'
python3 - <<'PY'
import json
import urllib.request
url = "https://api.github.com/repos/hyperpolymath/smtp-notify-action/git/trees/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7?recursive=1"
with urllib.request.urlopen(url) as response:
data = json.load(response)
for item in data.get("tree", []):
print(item["path"], item["type"])
PYRepository: hyperpolymath/thejeffparadox Length of output: 8022 Confirm the SMTP endpoint contract before merging. If 🤖 Prompt for AI Agents |
||
| 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 | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,120p' .github/workflows/push-email-notify.ymlRepository: hyperpolymath/thejeffparadox
Length of output: 3009
🌐 Web query:
GitHub Actions push branch filters branch deletion deleted true workflow trigger official documentation💡 Result:
When you delete a branch, GitHub Actions may trigger a push event because the branch deletion involves a push to the repository, during which the SHA reverts to the default branch [1][2]. There is no built-in
deleted: trueorignore-deleted: truefilter within the standardon.push.branchessyntax to prevent workflows from running on branch deletions [3][4][5]. To handle this, you can use the following methods: 1. Using the delete event: If you specifically want to run a workflow when a branch is deleted, you should use thedeleteevent trigger instead of thepushevent [6]. You can filter for branch deletions specifically by checking the event context:yaml on: delete: jobs: cleanup: if: github.event.ref_type == 'branch' runs-on: ubuntu-latest steps: - name: Handle branch deletion run: echo "Branch ${{ github.event.ref }} was deleted."2. Filtering in push workflows: If your push-triggered workflow is running unintentionally during deletions, you can add a conditional step or job to detect the state. However, since thepushevent on deletion does not natively provide a "deleted" flag in the standard push payload, many users use third-party actions designed to filter these events, or check the context if they need to explicitly avoid logic on deletions [7]. It is important to note that when a branch is deleted,GITHUB_REFwithin apushworkflow will typically point to the repository's default branch rather than the deleted branch, which can cause confusion if you are relying on that variable for logic [1][8][6]. If you need to act specifically on deletions, thedeleteevent is the officially recommended approach [6].Citations:
🌐 Web query:
site:docs.github.com/actions events that trigger workflows deleted branch push github.event deleted head_commit null💡 Result:
When a Git branch is deleted in a GitHub repository, it triggers the delete event, not the push event [1]. If you are seeing a workflow triggered by a push event where the head_commit is null, it is typically because the push event was for a branch deletion. According to official GitHub documentation, when a branch is deleted, GitHub triggers a push event payload where the head_commit is null to signify that there is no longer a tip commit for that reference [1]. Key points regarding this behavior: 1. Event Type: A branch deletion triggers the delete event [1]. However, the push webhook is also sent for branch deletions, resulting in a push event payload where the head_commit is set to null [1]. 2. Contextual Information: For push events involving branch deletions, the SHA associated with the workflow run reverts to the default branch of the repository because the specific branch ref no longer exists [1]. 3. Workflow Triggering: If you have a workflow configured with on: push, it will receive these events. To prevent your workflow from running during branch deletions, you can add a conditional check to your workflow steps or at the job level to verify that head_commit is not null or that the event is not a deletion [1]. Example of how to skip a job on branch deletion: jobs: my-job: if: ${{ github.event.head_commit!= null }} runs-on: ubuntu-latest steps: - run: echo "This only runs if a commit was pushed."
Citations:
Skip branch-deletion push payloads.
GitHub sends a
pushpayload for branch deletion withgithub.event.head_commit == null. The current job condition only checksPUSH_EMAIL_ENABLED, sonotifycan send a misleading email. Addgithub.event.head_commit != nullto the job condition.🤖 Prompt for AI Agents