-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Closed
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ee66c77
Added github action to check PR title format
ayushrakesh 64a9389
Added section -Pull Request Guidelines
ayushrakesh 6528d34
Merge pull request #2 from ayushrakesh/check-PR
ayushrakesh ec9a941
Merge branch 'main' into main
ayushrakesh 2f3100e
Merge branch 'thanos-io:main' into main
ayushrakesh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: PR Title Lint | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
|
||
jobs: | ||
pr-title-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Run PR title linter | ||
run: | | ||
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 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,32 @@ It is a good practice to keep your branch updated by rebasing your branch to mai | |
* If you feel like your PR is waiting too long for a review, feel free to ping the [`#thanos-dev`](https://slack.cncf.io/) channel on our slack for a review! | ||
* If you are a new contributor with no write access, you can tag in the respective maintainer for the changes, but be patient enough for the reviews. *Remember, good things take time :)* | ||
|
||
### 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. | ||
|
||
Comment on lines
+188
to
+213
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
### Dependency management | ||
|
||
The Thanos project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. This requires a working Go environment with version 1.11 or greater and git installed. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is not the format of pull request titles in Thanos. 🤔