- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.1k
 
refactor: Update the error message that is logged when PR title fails check #5059
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
… Conventional Commits regex
| 
           The latest updates on your projects. Learn more about Vercel for Git ↗︎ 
  | 
    
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.
cubic analysis
No issues found across 1 file. Review in cubic
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.
Greptile Summary
This PR refactors the PR labeler workflow by consolidating duplicate files and improving error messages for title validation failures. The change removes the empty .github/workflows/pr-labeller.yml file (note the double 'l') and adds a new .github/workflows/pr-labeler.yml file with enhanced functionality.
The new workflow validates PR titles against Conventional Commits format using a regex pattern that checks for standard prefixes like feat, fix, docs, etc. When validation fails, instead of providing a generic error message, the workflow now outputs a comprehensive, user-friendly message that includes:
- Clear explanation of the Conventional Commits requirement
 - Reasoning behind the standard (changelog automation and project history)
 - A reference link to learn more about Conventional Commits
 - Concrete examples of valid PR titles
 
The workflow uses pull_request_target trigger with appropriate read permissions and runs the validation logic in a shell script. This change addresses Linear issue DAN-2235 and represents a typical DevOps improvement focused on developer experience - transforming unhelpful error messages into actionable guidance that helps developers understand and fix issues quickly.
Confidence score: 4/5
• This PR is very safe to merge as it only improves error messaging and removes duplicate files without changing core functionality
• High confidence because the changes are straightforward workflow improvements with clear intent and no complex logic
• The pr-labeler.yml file needs attention to verify the regex pattern and error message formatting are correct
2 files reviewed, 1 comment
| echo "::error::❌ Your PR title does not follow the Conventional Commits format. | ||
| This check ensures that all pull requests use clear, consistent titles that help automate changelogs and improve project history. | ||
| 
               | 
          ||
| Please update your PR title to follow the Conventional Commits style. | ||
| Here is a link to a blog explaining the reason why we've included the Conventional Commits style into our PR titles: https://xfuture-blog.com/working-with-conventional-commits | ||
| 
               | 
          ||
| **Here are some examples of valid PR titles:** | ||
| - feat: add user authentication | ||
| - fix(login): handle null password error | ||
| - docs(readme): update installation instructions" | 
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.
logic: The multiline string in the echo command lacks proper quoting and may cause issues with shell interpretation of special characters like backticks and markdown formatting
| 
           Closed in favour of: #5062. Typo in branch name 😭...  | 
    
Description
This PR updates the labeler job to spit out a better error message when title validation fails.
Addresses: https://linear.app/danswer/issue/DAN-2235/update-error-message-of-pr-labeler-job.
How Has This Been Tested?
CI refactor; no testing done.
Summary by cubic
Updated the PR title validation job to show a clearer error message when the title does not follow the Conventional Commits format.