-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1351 from SciCatProject/add-pr-title-checker-gith…
…ub-action ci: add GitHub Action to enforce PR title format
- Loading branch information
Showing
7 changed files
with
101 additions
and
39 deletions.
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). |