-
Notifications
You must be signed in to change notification settings - Fork 23
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
ci: add GitHub Action to enforce PR title format #1351
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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,15 @@ | ||
{ | ||
"LABEL": { | ||
"name": "" | ||
}, | ||
"CHECKS": { | ||
"NOTE": "You can test the regex here: https://regex101.com/r/nDeps5/1", | ||
"regexp": "(^(?<type>build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|BREAKING CHANGE)(?<scope>\\([\\w\\s*-]+\\))?(?<breaking_change>!?): (?<body>([a-z]).+[^.|\\s])$)", | ||
"regexpFlags": "gm" | ||
}, | ||
"MESSAGES": { | ||
"success": "All OK", | ||
"failure": "PR title not following the semantic-release guidelines. Please check https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines for more information.", | ||
"notice": "" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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,22 @@ | ||
name: PR Title Checker | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- labeled | ||
- unlabeled | ||
|
||
jobs: | ||
check-pr-title: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: thehanimo/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
pass_on_octokit_error: false | ||
configuration_path: .github/pr-title-checker-config.json #(optional. defaults to .github/pr-title-checker-config.json) |
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
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,37 @@ | ||
# Pull Request Guidelines | ||
|
||
When creating a pull request (PR) for this repository, it's important to follow the guidelines for PR titles and PR template to ensure consistency and clarity. Proper PR titles help maintain a clear and understandable project history and facilitate better release notes. | ||
|
||
## PR Title Format | ||
|
||
All PR titles must adhere to the conventional commits format. This format helps in automating the release process and generating changelogs. The format is as follows: | ||
|
||
``` | ||
<type>(<scope>): <description> | ||
``` | ||
|
||
type: The type of change being made. It must be one of the following: | ||
|
||
- `feat:` A new feature | ||
- `fix:` A bug fix | ||
- `ci:` Continuous integration-related changes. | ||
- `docs:` Documentation only changes | ||
- `style:` Changes that do not affect the meaning of the code (white -space, formatting, missing semi -colons, etc) | ||
- `refactor:` A code change that neither fixes a bug nor adds a feature | ||
- `revert`: Reverts a previous commit. | ||
- `perf:` A code change that improves performance | ||
- `test:` Adding missing or correcting existing tests | ||
- `chore:` Changes to the build process or auxiliary tools and libraries such as documentation generation | ||
- `build:` Changes that affect the build system or external dependencies. | ||
- `BREAKING CHANGE:` A change that introduces a breaking API change. | ||
|
||
scope: An `optional` description of the section of the codebase affected by the changes (e.g., api, ui, docs). This is enclosed in parentheses. | ||
|
||
description: A brief summary of the changes made. | ||
|
||
## Examples | ||
|
||
- feat(api): add new endpoint for data retrieval | ||
- fix(ui): correct button alignment on mobile devices | ||
- docs: update contributing guidelines | ||
- BREAKING CHANGE: refactor authentication middleware to use new library |
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 @@ | ||
# New Release Version Bump Workflow | ||
|
||
## Workflow Overview | ||
|
||
Scicat Backend controls new releases with the `GitHub-tag-and-release` GitHub Action. This workflow is triggered by push events to the release branch. It automates the version bumping and release processes based on semantic commit messages. Full documentation of the action package can be found on [github-tag-action](https://github.com/marketplace/actions/github-tag) | ||
|
||
The image below shows visualized workflow. | ||
![image](https://github.com/SciCatProject/scicat-backend-next/assets/78078898/0f3c5386-4a16-4ed1-a2ee-d71ef6f34e99) | ||
|
||
## Workflow Trigger Condition | ||
|
||
> [!Caution] | ||
> Any push to the `release` branch initiates the workflow. | ||
|
||
## Versioning and Release Strategy | ||
|
||
**Semantic Versioning:** | ||
|
||
- The version is automatically bumped according to the semantic PR titles, using the [semantic-release](https://github.com/semantic-release/semantic-release) conventions: | ||
|
||
- `fix:` prefixed titles generate a patch release. | ||
- `feat:` prefixed titles generate a minor release. | ||
- `BREAKING CHANGE:` in the commit message triggers a major release. | ||
|
||
**Auto-generated Release Notes:** | ||
|
||
The release log is automatically populated with all commit messages since the last tag, providing a detailed changelog for the release. By default semantic-release uses [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines). |
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.
Do you mind leave the main README minimal and move the PR information in a dedicated file under folder
docs
.Maybe something like
docs/contributing/pr-guidlines.md