-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #118
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@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 | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '1,90p' .github/workflows/push-email-notify.yml
printf '\n--- action references and input context ---\n'
rg -n -C 4 'smtp-notify-action|SMTP_HOST|SMTP_PORT|secure:|server_address|server_port|AUTH' .github README.md 2>/dev/null || trueRepository: hyperpolymath/panll Length of output: 5324 🌐 Web query:
💡 Result: The string 'ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7' appears to be a specific commit hash [1][2][3][4][5] associated with the GitHub organization 'hyperpolymath', specifically found in '.github/workflows/push-email-notify.yml' files [1][2][3][4][5]. These workflows utilize the 'dawidd6/action-send-mail' GitHub Action to handle SMTP notifications [1][2][3][4][5]. Regarding the integration of 'smtp-notify-action' with 'AUTH PLAIN' and 'Microsoft 365': 1. SMTP Authentication with Microsoft 365: Microsoft 365 (formerly Office 365) has deprecated Basic Authentication (AUTH PLAIN) in favor of OAuth 2.0. If you are attempting to configure an SMTP action using 'AUTH PLAIN' with Microsoft 365, it will likely fail unless you are using a specific legacy configuration or an Authenticated SMTP relay that Microsoft has not yet blocked or that requires specific tenant-level permissions. 2. Troubleshooting: When migrating or configuring SMTP notifications, 'MIGRATION.adoc' files are commonly found in software repositories to document breaking changes [6]. If you are encountering issues, it is recommended to review your project's 'MIGRATION.adoc' (if present) for instructions on updating authentication mechanisms, such as switching from 'AUTH PLAIN' to OAuth 2.0 or using a different relay service. 3. Configuration: In the hyperpolymath workflows identified, the action is configured with 'secure: true' [1][2][3][4][5]. Ensure that your SMTP server settings are compatible with Microsoft 365's current requirements, which typically involve using 'smtp.office365.com' on port 587 with STARTTLS, and increasingly, OAuth 2.0 tokens rather than plain text passwords. Citations:
🏁 Script executed: set -eu
base='https://raw.githubusercontent.com/hyperpolymath/smtp-notify-action/ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7'
for file in action.yml action.yaml README.md MIGRATION.adoc; do
echo "===== $file ====="
curl -fsSL "$base/$file" | sed -n '1,240p' || true
doneRepository: hyperpolymath/panll Length of output: 15810 Verify the SMTP endpoint before enabling notifications. The workflow passes 🤖 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/panll
Length of output: 3399
🌐 Web query:
GitHub Actions push event branch deletion branches filter github.event.deleted head_commit documentation💡 Result:
When managing branch deletions in GitHub Actions, it is important to distinguish between the
deleteevent and thepushevent, as they handle branch removal differently [1][2]. 1. Using thedeleteevent: Thedeleteevent is the primary and recommended way to trigger workflows when a branch or tag is removed [1][3]. In adeleteevent, thegithub.event.refproperty contains the name of the deleted branch, andgithub.event.ref_typeidentifies whether it was abranchortag[4][3]. Because theGITHUB_REFenvironment variable typically points to the repository's default branch during adeleteevent, you should rely on thegithub.eventcontext to identify the specific branch that was removed [1][4][3]. Example filter for thedeleteevent: if: github.event.ref_type == 'branch' 2. Thepushevent and branch deletion: While a branch deletion can technically trigger apushevent, the behavior is often problematic for filtering [5][2]. During a deletion, theGITHUB_SHAin the workflow run reverts to the default branch, and standard branch filters may not behave as expected because the branch no longer exists [1][6]. Thepushevent payload includes adeletedboolean (e.g.,github.event.deleted) which indicates if the push operation was a deletion [2][7]. 3.head_commitcontext: In the context of apushevent,head_commitprovides information about the commit [2][8]. However, when a branch is deleted, thehead_commitobject may be null or represent the state of the default branch, rather than the deleted branch [1][2]. Consequently, you should avoid relying onhead_commitdata to identify or process deleted branches [9]. Recommendation: To handle branch deletions, use theon: deletetrigger in your workflow [3]. Use thegithub.event.refproperty to obtain the deleted branch name andgithub.event.ref_type == 'branch'to ensure the workflow only executes for branch deletions [3]. If you must use apushevent, be aware that standardbranchesfilters may be insufficient or unreliable for deletion scenarios [1][5].Citations:
🌐 Web query:
site:docs.github.com/en/actions "deleted" "push" "branches" workflow💡 Result:
In a Git workflow, deleting a remote branch after it has been pushed and merged is a standard housekeeping task to maintain repository cleanliness. To delete a remote branch from your local machine, use the following command: git push <remote_name> --delete <branch_name> Commonly, this is done after the branch has been merged into the default branch (e.g., main or master) via a pull request or merge request. Regarding automation, if you are using GitHub Actions, you can trigger workflows specifically when a branch is deleted by using the delete event [1]. This allows you to perform cleanup tasks, such as removing associated environments, caches, or infrastructure, automatically upon branch deletion [1]. Workflow Configuration for Deletions: To run a workflow when a branch is deleted, configure the on trigger in your YAML file as follows [1]: on: delete: This event runs the workflow when someone deletes a Git reference (branch or tag) [1]. Within the workflow, you can access information about the deleted branch using the github.event context to determine which branch was removed [2][3]. Best Practices: 1. Prune Local Branches: After deleting a remote branch, it is good practice to synchronize your local repository to remove tracking branches that no longer exist on the remote: git fetch --prune 2. Use Protection Rules: Ensure that your default branch (e.g., main) is protected to prevent accidental deletion or forced pushes. 3. Automate Cleanup: Use the delete event in CI/CD pipelines to clean up ephemeral resources tied to feature branches, preventing resource leaks in cloud environments [1].
Citations:
🌐 Web query:
GitHub webhook push payload deleted true head_commit null branch deletion push event official documentation💡 Result:
Yes, when a branch or tag is deleted on GitHub, it triggers a push event in the webhook payload where the deleted field is set to true and the head_commit field is null [1][2][3]. Official GitHub documentation confirms that the push event includes information about branch and tag deletions [1][2]. In the webhook payload object for a push event, the following fields explicitly indicate a deletion: deleted: A boolean that is true when the push event represents the deletion of a ref (branch or tag) [1][2]. head_commit: An object containing information about the head commit, which is null when a ref is deleted because there is no remaining head commit to reference [1][2][3]. after: This field is also set to a null string (all zeros, e.g., 0000000000000000000000000000000000000000) when a branch is deleted [3]. If your application's logic or automation workflows need to handle these events, it is standard practice to check if the deleted field is true to ignore these events or perform specific cleanup tasks, preventing the system from attempting to process or build a non-existent branch [4][3]. While the push event covers these deletions, you can also subscribe to the specific delete webhook event if you wish to monitor only branch and tag deletions without receiving all push events [1][2].
Citations:
🌐 Web query:
site:docs.github.com "This value is null when the push is a branch deletion" "branches"💡 Result:
In the context of GitHub webhook push events, the head_commit field is null when a branch or tag deletion occurs [1][2]. The push webhook event covers several scenarios, including standard commits, branch creation, tag creation, and branch or tag deletion [1][3]. When a branch is deleted, the payload indicates this by setting the deleted boolean field to true [1][4]. Because no commit exists at the "head" of a branch that has just been removed, the head_commit object is explicitly set to null in the payload [1][2]. Similarly, the after field (representing the SHA of the most recent commit after the push) is also set to 0000000000000000000000000000000000000000 (a zeroed SHA) or null, depending on the specific API versioning and handling, as there is no resulting commit state for that reference [1][5].
Citations:
Exclude branch-deletion pushes.
branches: ['**']permits branch-deletionpushevents. These events setgithub.event.deletedtotrueandhead_committonull. Add&& !github.event.deletedto thenotifyjob condition.🤖 Prompt for AI Agents
Source: MCP tools