-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #332
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,27 @@ | |
| # 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: ['**'] | ||
| 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.1.0 # NOSONAR — pin authority is actions.lock (sha1-1b3b752d39a4fe4c0f28f10905e4608789d3e050) | ||
|
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: printf '%s\n' '--- repository conventions ---'
find /tmp/coderabbit-repo-knowledge/hyperpolymath-academic-workflow-suite-1c7733a0 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/push-email-notify.yml
printf '%s\n' '--- lock references ---'
rg -n -C 3 'smtp-notify-action|1b3b752d39a4fe4c0f28f10905e4608789d3e050|v0\.1\.0' .githubRepository: hyperpolymath/academic-workflow-suite Length of output: 5614 🏁 Script executed: printf '%s\n' '--- CI and review conventions ---'
cat /tmp/coderabbit-repo-knowledge/hyperpolymath-academic-workflow-suite-1c7733a0/architecture/ci.md
cat /tmp/coderabbit-repo-knowledge/hyperpolymath-academic-workflow-suite-1c7733a0/architecture/repo-guidelines.md
printf '%s\n' '--- tag reference ---'
gh api repos/hyperpolymath/smtp-notify-action/git/ref/tags/v0.1.0 --jq '.object | "\(.type) \(.sha)"'Repository: hyperpolymath/academic-workflow-suite Length of output: 2035 🏁 Script executed: tag_object="$(gh api repos/hyperpolymath/smtp-notify-action/git/ref/tags/v0.1.0 --jq '.object.sha')"
tag_commit="$(gh api "repos/hyperpolymath/smtp-notify-action/git/tags/${tag_object}" --jq '.object | "\(.type) \(.sha)"')"
printf 'tag_object %s\n' "$tag_object"
printf 'tag_target %s\n' "$tag_commit"
printf 'tag_commit_validation '
gh api repos/hyperpolymath/smtp-notify-action/commits/1fb433a0048cf21f40499d54b1bd236ad52b6bc9 --jq '.sha'
printf 'lock_sha_validation '
gh api repos/hyperpolymath/smtp-notify-action/commits/1b3b752d39a4fe4c0f28f10905e4608789d3e050 --jq '.sha'Repository: hyperpolymath/academic-workflow-suite Length of output: 624 🏁 Script executed: printf '%s\n' '--- workflow pinning policy references ---'
rg -n -i -C 3 'actions\.lock|pin(ned|ning)?|commit SHA|full SHA|mutable tag|uses:' \
.github .claude CLAUDE.md README.adoc 2>/dev/null | head -250
printf '%s\n' '--- action-lock configuration and documentation files ---'
find . -maxdepth 4 -type f \( -iname '*action*lock*' -o -iname '*workflow*' -o -iname '*security*' \) -printRepository: hyperpolymath/academic-workflow-suite Length of output: 17511 Pin the action by commit SHA.
🧰 Tools🪛 zizmor (1.29.0)[error] 27-27: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST 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/academic-workflow-suite
Length of output: 8540
🌐 Web query:
GitHub Actions push event branch deletion branches filter github.event.deleted head_commit null official documentation💡 Result:
When a branch is deleted in a repository, GitHub triggers a push event payload where the deleted property is set to true and the head_commit property is null [1][2]. Because this push event is sent for the default branch (reflecting the state after the deletion), it can inadvertently trigger workflows configured to run on push events [3][2]. To prevent your workflows from running during branch deletion, you can add a conditional filter to your job using the if expression [4]. Example filter: jobs: job_name: runs-on: ubuntu-latest if: ${{!github.event.deleted }} steps: - name: Run only on non-deletion pushes run: echo "This step will not run when a branch is deleted." For more advanced requirements, such as filtering branch deletions themselves, you should use the delete event type, which provides specific information about the branch being removed [5][1]. Example of handling branch deletions separately: on: push: branches: - main delete: jobs: handle_push: if: ${{ github.event_name == 'push' &&!github.event.deleted }} runs-on: ubuntu-latest steps: - run: echo "Handling push" handle_delete: if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' }} runs-on: ubuntu-latest steps: - run: echo "Branch ${{ github.event.ref }} was deleted" Key technical details: - Payload structure: When a branch is deleted, the push event payload includes deleted: true and head_commit: null [1][2]. - Default behavior: GitHub Actions treats the push event associated with a deletion as a push to the repository's default branch, which is why standard branch filters may not effectively exclude these events [3][2]. - Filtering: Using the if condition is the recommended way to ignore these events at the job level [4]. Always check github.event.deleted or evaluate github.event.head_commit to safely manage your workflow execution [1][2].
Citations:
Exclude branch-deletion events before running the job.
branches: ['**']does not exclude branch deletions. A matching deletion event can run the job withgithub.event.head_commitset tonull, producing an incomplete notification. Add&& !github.event.deletedto the job condition.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 13-16: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents