Skip to content

Commit e5503a8

Browse files
authored
ci: Adds a PR title checker GitHub Action (#846)
* add action and docs * add hint to PR template
1 parent 20e4078 commit e5503a8

File tree

3 files changed

+47
-15
lines changed

3 files changed

+47
-15
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
## Pull Request Type
1313
What kind of change does this Pull Request introduce?
1414

15-
<!-- Please check the one that applies to this PR using "x". -->
15+
<!-- Please check the one that applies to this PR using "x", and prefix your PR title with the corresponding `type` -->
1616
```
17-
[ ] Bugfix
18-
[ ] Feature
19-
[ ] Code style update (formatting, local variables)
20-
[ ] Refactoring (no functional changes, no api changes)
21-
[ ] Documentation content changes
22-
[ ] Other... Please describe:
17+
[ ] Bugfix (`fix`)
18+
[ ] Feature (`feat`)
19+
[ ] Code style update (formatting, local variables) (`style`)
20+
[ ] Refactoring (no functional changes, no api changes) (`refactor`)
21+
[ ] Documentation content changes (`docs`)
22+
[ ] Other... Please describe: (`perf`, `test`, `build`, `ci`, `chore`, `revert`)
2323
```
2424

2525
## How to Test
@@ -42,4 +42,4 @@ Verify that the following are valid
4242
* ...
4343

4444
## Other Information
45-
<!-- Add any other helpful information that may be needed here. -->
45+
<!-- Add any other helpful information that may be needed here. -->
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "pr-title-checker"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
pull-requests: read
12+
13+
jobs:
14+
main:
15+
name: Validate PR title
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@v5
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ a proposal for your work first, to be sure that we can use it.
3636

3737
Poetry is a package manager for Python that allows developers to manage dependencies, create virtual environments, and package their projects for distribution, all using a single command-line tool.
3838

39-
Poetry is setup for you in the devcontainer, but should you need to set this up manually you can
39+
Poetry is setup for you in the devcontainer, but should you need to set this up manually you can
4040
```sh
4141
sh ./.devcontainer/postCreate.sh
4242
```
4343

4444
The following manual steps can also be followed to setup poetry:
45-
- Poetry can be installed using `pip install poetry`.
46-
- Using `poetry init` poetry creates a `pyproject.toml` file with all the main dependencies required to run the application.
45+
- Poetry can be installed using `pip install poetry`.
46+
- Using `poetry init` poetry creates a `pyproject.toml` file with all the main dependencies required to run the application.
4747
- Executing `poetry install` from the root folder which has the `pyproject.toml` file, installs all the dependencies and creates a virtual environment which is used to run the application. `poetry install` also generates a `poetry.lock` file which locks the dependency versions so that any user who installs the application get the same package version.
4848
- Executing `pip install .` from the root folder only installs the main dependencies.
4949
- Dependencies for different environments (dev, test etc.) can be managed by creating groups in the `pyproject.toml` file.
@@ -54,7 +54,7 @@ The following manual steps can also be followed to setup poetry:
5454
To add a new package execute the below command:
5555
```shell
5656
poetry add <package-name>
57-
```
57+
```
5858
To add a package to specific group:
5959
``` shell
6060
poetry add <package-name> --group <group-name>
@@ -64,9 +64,9 @@ The following manual steps can also be followed to setup poetry:
6464

6565
**Note**: In case the pyproject.toml file is manually updated, the following command should be executed to update the `poetry.lock` file.
6666

67-
``` shell
67+
``` shell
6868
poetry lock --no-update
69-
```
69+
```
7070
`--no-update` Locks the packages without updating the locked versions.
7171

7272
## <a name="submit"></a> Submission Guidelines
@@ -101,7 +101,19 @@ Before you submit your Pull Request (PR) consider the following guidelines:
101101
* Commit your changes using a descriptive commit message
102102
* If you are using the devcontainer, committing code will run black and flake8 to lint python code. You can run `black .` or `flake8 .` at anytime.
103103
* Push your fork to GitHub:
104-
* In GitHub, create a pull request
104+
* In GitHub, create a pull request. **Note**: We require PRs to be named following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. This is where PRs are prefixed according to their type. The available types are:
105+
* feat: A new feature
106+
* fix: A bug fix
107+
* docs: Documentation only changes
108+
* style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
109+
* refactor: A code change that neither fixes a bug nor adds a feature
110+
* perf: A code change that improves performance
111+
* test: Adding missing tests or correcting existing tests
112+
* build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
113+
* ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
114+
* chore: Other changes that don't modify src or test files
115+
* revert: Reverts a previous commit
116+
105117
* If we suggest changes then:
106118
* Make the required updates.
107119
* Rebase your fork and force push to your GitHub repository (this will update your Pull Request):

0 commit comments

Comments
 (0)