-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #68
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 }} | ||
|
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' '--- .github/workflows/push-email-notify.yml ---'
cat -n .github/workflows/push-email-notify.ymlRepository: hyperpolymath/fireflag Length of output: 3450 🌐 Web query:
💡 Result: In GitHub Actions, workflow re-runs behave as follows regarding context variables and concurrency: 1. Context Persistence and Changes The github.run_id remains constant across all re-runs of a workflow [1][2]. This ID identifies the initial workflow execution [3]. In contrast, github.run_attempt is a unique number that increments with every re-run of a specific workflow execution [1][2]. The initial run starts at 1, and subsequent re-runs will increment this value (e.g., 2, 3, etc.) [1][2]. These context variables are essential for creating unique identifiers (e.g., for build IDs or tracing) across retries, as github.run_id alone does not distinguish between re-run attempts [4][5]. 2. Concurrency Group Semantics Concurrency groups are used to limit the number of simultaneous workflow runs or jobs [6][7]. When a concurrency group is defined: - If a new workflow run or job is triggered with the same concurrency group name, GitHub Actions enforces limits based on your configuration [6][8]. - By default, GitHub Actions allows only one active run and one pending run in a group; if another run enters, the existing pending run is canceled [6][9]. - You can now configure queues to allow multiple pending runs (up to 100) to execute sequentially by setting queue: max in the concurrency block [10][8]. - Concurrency group names can use dynamic expressions, including github context variables [6][8]. If you use github.run_id in a concurrency group name, all re-runs of that workflow will share the same concurrency group identifier because the run_id does not change [1][2]. If you incorporate github.run_attempt into the concurrency group name, each re-run would technically form a distinct, unique concurrency group, effectively bypassing the intended limiting behavior of the concurrency group across re-runs [6][9]. Citations:
Include
🤖 Prompt for AI AgentsSource: MCP tools |
||
| 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 | ||
| 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,80p' .github/workflows/push-email-notify.ymlRepository: hyperpolymath/fireflag
Length of output: 3003
🤖 get_repo_knowledge executed:
get_repo_knowledge hyperpolymath/fireflag /tmp/coderabbit-repo-knowledge/hyperpolymath-fireflag-ebaa501f/architectureLength of output: 2403
🌐 Web query:
site:docs.github.com GitHub Actions push event branch deletion branches filter github.event.deleted head_commit null💡 Result:
When a branch is deleted in a GitHub repository, the push event is triggered with specific characteristics in the webhook payload, including head_commit being set to null [1][2]. Key details regarding this behavior: 1. Payload Characteristics: In a push event triggered by branch deletion, the boolean deleted field in the webhook payload is set to true [1][2]. Simultaneously, the head_commit field is set to null, as there is no longer a commit associated with that reference [1][2]. 2. Detecting Deletion: You can use these payload properties within a GitHub Actions workflow to conditionally execute steps. For example, you can use a step with an if conditional to check if the push represents a deletion: if: ${{ github.event.deleted == true }} 3. Event Filtering: The standard branches filter in the push event configuration (on.push.branches) is designed to trigger workflows when a branch matching the pattern is pushed to [3][4]. Because branch deletion is technically a push event, it can trigger these workflows [5][2]. If you only want to handle branch deletions specifically, you may prefer using the delete event instead of the push event [6][2]. Unlike the push event, the delete event is specifically for when a Git reference (branch or tag) is removed [6][2]. 4. Important Considerations: When a branch is deleted, the GITHUB_SHA and GITHUB_REF in the workflow context will typically point to the repository's default branch rather than the deleted branch, because the branch no longer exists at the time the action runs [3][5]. If your goal is to perform cleanup tasks triggered by deletions, relying on the delete event or explicitly checking github.event.deleted in a push workflow are the standard approaches [1][6][2].
Citations:
Exclude branch-deletion events.
The
push.branches: ['**']filter also permits branch deletion events. These payloads setgithub.event.deletedtotrueandgithub.event.head_committonull, so the workflow can send a misleading notification without a head message. Add!github.event.deletedto the existing job condition.🤖 Prompt for AI Agents
Source: MCP tools