-
Notifications
You must be signed in to change notification settings - Fork 100
Added block branch creation from staging #11627
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
WalkthroughA new GitHub Actions workflow file has been added to block branch creation from a branch with a base ending in "-staging". The workflow triggers on branch creation events, retrieves the current and base branch references from the event context, and then checks if the base branch is derived from staging. Depending on the evaluation, it logs a corresponding message and either allows or prevents the branch creation. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer as Developer
participant GitHub as GitHub Actions
participant Job as prevent-from-staging Job
participant Logger as Logger
Developer->>GitHub: Create new branch
GitHub->>Job: Trigger workflow on branch creation
Job->>Job: Retrieve current and base branch references
alt Base branch reference not available
Job->>Logger: Log message and exit successfully
else Base branch reference ends with "-staging"
Job->>Logger: Log error message and exit with failure
else Other branch creation
Job->>Logger: Log permitted branch creation and exit successfully
end
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
🧹 Nitpick comments (1)
.github/workflows/block_branch_creation_from_staging.yml (1)
3-7
: Review Branch Filter Usage for Create EventsThe workflow currently specifies a
branches
filter (lines 5–6) under thecreate
event. However, GitHub Actions does not support branch filtering for thecreate
event (as noted by actionlint), so this filter will not have any effect. Consider removing it or revisiting the event trigger if you intend to restrict branch creation based on branch names.🧰 Tools
🪛 actionlint (1.7.4)
5-5: "branches" filter is not available for create event. it is only for merge_group, push, pull_request, pull_request_target, workflow_run events
(events)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/block_branch_creation_from_staging.yml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/block_branch_creation_from_staging.yml
5-5: "branches" filter is not available for create event. it is only for merge_group, push, pull_request, pull_request_target, workflow_run events
(events)
Summary by CodeRabbit