-
Notifications
You must be signed in to change notification settings - Fork 2
ci: Add pull_request and push triggers, and restrict test job to workflow_dispatch. #3
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
Conversation
WalkthroughThe GitHub Actions workflow configuration is updated to trigger on push and pull request events for specific branches (master, releases/, v), with a conditional guard added to ensure the test job executes only when manually dispatched via workflow_dispatch event. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/test.yml(2 hunks)
🔇 Additional comments (1)
.github/workflows/test.yml (1)
20-20: Test job conditional guard is appropriately restrictive.The conditional
if: ${{ github.event_name == 'workflow_dispatch' }}correctly ensures the test job—which sends notifications to an external Feishu bot using secrets—only executes on manual dispatch. This prevents unnecessary notification spam and unintended secret exposure on every PR and push. Well done.
| pull_request: | ||
| push: | ||
| branches: | ||
| - master | ||
| - 'releases/*' | ||
| - 'v*' |
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.
Add branch filtering to pull_request trigger for consistency.
The pull_request trigger lacks branch filters while the push trigger restricts to master, releases/*, and v* branches. This inconsistency means pull requests from any branch targeting any branch will trigger the workflow, which may not align with your intent. For consistency and to avoid unnecessary workflow runs, add branch filters to the pull_request trigger:
on:
workflow_dispatch:
- pull_request:
+ pull_request:
+ branches:
+ - master
+ - 'releases/*'
+ - 'v*'
push:
branches:
- master
- 'releases/*'
- 'v*'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| - 'releases/*' | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - master | |
| - 'releases/*' | |
| - 'v*' | |
| push: | |
| branches: | |
| - master | |
| - 'releases/*' | |
| - 'v*' |
🤖 Prompt for AI Agents
.github/workflows/test.yml around lines 4 to 9: the pull_request trigger
currently has no branch filters while push is limited to master, releases/*, and
v*; update the pull_request trigger to include the same branch filters (master,
'releases/*', and 'v*') so the workflow only runs for PRs targeting those
branches, mirroring the push configuration.
🎉🎉🎉🎉
bash:Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.