-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #170
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
Open
hyperpolymath
wants to merge
1
commit into
main
Choose a base branch
from
chore/smtp-notify-action
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/bofig
Length of output: 9841
🌐 Web query:
GitHub Actions push event branch deletion branches filter github.event.deleted true head_commit null💡 Result:
When a branch is deleted on GitHub, the push event is triggered, but the behavior of the GitHub Actions environment changes, often resulting in head_commit being null [1][2][3]. Because the push event includes branch deletions, workflows configured to trigger on push may unexpectedly run when a branch is deleted, which can cause issues such as unintended deployments [4][5]. Key Technical Details: - Push Event Behavior: When you delete a branch, GitHub sends a push event where the deleted property is set to true [2][6]. In this context, GITHUB_SHA and GITHUB_REF typically revert to the default branch of the repository, and the head_commit object in the webhook payload is often null [1][2][3]. - Handling Branch Deletion: You cannot directly filter branch deletions using the standard branches filter in the push event configuration [1][7]. To prevent a workflow from running on branch deletion, you must add a conditional check to your jobs using the github context [5][8]. Recommended Pattern: To filter out deleted branches within a push event, use an if conditional to check the github.event.deleted property [5]. jobs: my_job: runs-on: ubuntu-latest if: ${{!github.event.deleted }} steps: - run: echo "This only runs on actual pushes, not deletions." If you specifically want to handle branch deletions (e.g., for cleanup tasks), it is best practice to use the delete event instead of relying on the push event [2][8]. on: delete: jobs: on-delete: if: github.event.ref_type == 'branch' runs-on: ubuntu-latest steps: - run: echo "Branch ${{ github.event.ref }} was deleted." By using the delete event, you can accurately identify which branch was removed via github.event.ref, whereas in a push event, this information is often obscured because the environment defaults to the repository's main branch [9][8].
Citations:
Exclude branch-deletion events explicitly.
branches: ['**']does not exclude deleted branches. Whengithub.event.deletedistrue,head_commitcan benull, but the job still runs whenPUSH_EMAIL_ENABLEDistrue. Addgithub.event.deleted != trueto the job condition.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 12-15: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents
Source: MCP tools