-
Notifications
You must be signed in to change notification settings - Fork 2
ci(dev-infra): change behavior of pr-title-lint action to bypass branch protections #26
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
Signed-off-by: Antonia Gaete <[email protected]>
WalkthroughUpdated the PR title lint workflow by adding two inputs to adjust failure handling: no automatic “request changes” on regex mismatches, and the action now fails the workflow on mismatch. Other behavior remains unchanged. Changes
Sequence Diagram(s)sequenceDiagram
actor Developer
participant GitHub as GitHub (PR)
participant Workflow as PR Title Lint Workflow
participant Action as pr-lint-action
Developer->>GitHub: Open/Update PR
GitHub->>Workflow: Trigger
Workflow->>Action: Run title regex check
alt Title matches regex
Action-->>Workflow: success
Workflow-->>GitHub: Dismiss prior review (if any)
else Title fails regex
Action-->>GitHub: Post failure comment
Action-->>Workflow: fail job (no "request changes")
Workflow-->>GitHub: Workflow marked failed
end
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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.
Conventional Commits FTW!
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: 0
🧹 Nitpick comments (2)
.github/workflows/_pr-title-lint.yml (2)
28-29: Scope the GITHUB_TOKEN permissions explicitly to least privilege.Because the action still posts a failure comment, it needs pull-requests: write. Recommend adding explicit permissions to the job (or workflow) to avoid broader defaults.
Example:
permissions: contents: read pull-requests: write
28-29: Pin the action to a commit SHA to reduce supply-chain risk.Instead of a mutable tag, use a specific commit SHA and keep a comment with the version for readability.
Example:
uses: morrisoncole/pr-lint-action@<pinned_commit_sha> # v1.7.1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/_pr-title-lint.yml(1 hunks)
🔇 Additional comments (2)
.github/workflows/_pr-title-lint.yml (2)
28-29: Change meets objective: failing the action (instead of requesting changes) will block merges without elevated review permissions.This correctly sidesteps GITHUB_TOKEN review-dismissal limitations while preserving enforcement via a failing status.
28-29: Ensure the status check is required in branch protection.This job will fail on a bad title; it will only block merges if the “PR Title Lint” job (or its parent workflow’s check) is marked as a required status check on protected branches. Please verify repo settings after merge.
No description provided.