Skip to content
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

feat: Github action to verify format of PR titles. #7463

Closed
wants to merge 5 commits into from
Closed

feat: Github action to verify format of PR titles. #7463

wants to merge 5 commits into from

Conversation

ayushrakesh
Copy link

@ayushrakesh ayushrakesh commented Jun 15, 2024

Added Github action to check the titles of pull requests are properly formatted.

Changelog entry format:
- #7463 Thanos github-workflows ...

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Added one yaml file to implement the same and modify CONTRIBUTING.md file to illustrate valid pull requests title's format.

Verification

I have tested it with some test PR in my repo.

ayushrakesh and others added 3 commits June 15, 2024 20:37
feat: Github action to check PR's title format.
Comment on lines +21 to +26
TITLE=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH")
if [[ ! "$TITLE" =~ ^(fix|feat|docs|style|refactor|perf|test|chore):\ .{1,50}$ ]]; then
echo "Invalid PR title: $TITLE"
echo "PR titles must start with one of the following types: fix, feat, docs, style, refactor, perf, test, chore."
echo "Followed by a colon and space, and a brief description (1-50 characters)."
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the format of pull request titles in Thanos. 🤔

Comment on lines +188 to +213
### Pull Request Guidelines

To ensure a consistent and meaningful naming convention for pull requests (PRs), please follow these guidelines:

#### PR Title Format

PR titles should follow this pattern:
- `type: brief description`

Where `type` is one of the following:
- `fix`: A bug fix
- `feat`: A new feature
- `docs`: Documentation changes
- `style`: Code style changes (formatting, missing semi-colons, etc.)
- `refactor`: Code refactoring without changing functionality
- `perf`: Performance improvements
- `test`: Adding or updating tests
- `chore`: Maintenance tasks (dependency updates, tool changes, etc.)

#### Examples
- `fix: Correct typo in README`
- `feat: Add new storage backend support`
- `docs: Update contributing guidelines`

Failure to follow this convention will result in a failing check on your PR.

Copy link
Contributor

@douglascamata douglascamata Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. The pull request guidelines are included in the pull request template: https://raw.githubusercontent.com/thanos-io/thanos/main/.github/PULL_REQUEST_TEMPLATE.md

@ayushrakesh
Copy link
Author

@douglascamata I have raised another PR for it. Please review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants