-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): repoint push-email-notify to smtp-notify-action #52
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
Merged
Merged
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 | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: hyperpolymath/live-files
Length of output: 162
🏁 Script executed:
Repository: hyperpolymath/live-files
Length of output: 3404
🌐 Web query:
GitHub Actions push event deleted branch head_commit null workflow syntax branches filter💡 Result:
When a Git branch is deleted, GitHub triggers a push event with the deleted flag set to true in the webhook payload [1][2][3]. In this scenario, the head_commit property in the payload is null [1][3]. To handle this in your GitHub Actions workflow, you should be aware of the following technical behaviors: 1. Payload Structure: Because head_commit is null when a branch is deleted, any attempt to access properties like ${{ github.event.head_commit.message }} will fail or cause runtime errors if the workflow is triggered by a branch deletion [4][5]. You should implement conditional checks or use safe access patterns in your workflow logic to account for this [5]. 2. Branches Filter: The branches filter in the workflow syntax (on.push.branches) controls which branch pushes trigger the workflow [6][7]. When a branch is deleted, it is still technically a push event [1]. If your workflow has a branches filter that matches the name of the deleted branch, the workflow will be triggered unless the event payload is explicitly handled [2]. To prevent workflows from running on branch deletions, you can check the deleted status within a job step: jobs: job_name: if: github.event.deleted == false runs-on: ubuntu-latest steps: - name: Your step run: echo "This only runs if the branch was not deleted." 3. Context Access: If your workflow accesses github.event.head_commit without verifying that the event is a standard push (and not a deletion), you may encounter errors [5]. If you need information about the pushed commits, rely on the commits array in the payload instead of head_commit, but note that this array is also often empty or null during a deletion event [1][3].
Citations:
🤖 get_repo_knowledge executed:
get_repo_knowledge hyperpolymath/live-files /tmp/coderabbit-repo-knowledge/hyperpolymath-live-files-1377c289/architectureLength of output: 2333
Skip deleted branch pushes.
on.push.branches: ['**']also matches branch-deletion push events. These payloads setgithub.event.deletedtotrueandgithub.event.head_committonull, so the job can send an incomplete notification. Add the deletion guard and update the comment at line 14.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents