|
1 | | -#  |
| 1 | + |
2 | 2 |
|
3 | | -## HAProxy Github Actions |
| 3 | +# GitHub Action: Check commit subject is compliant with HAProxy guidelines |
4 | 4 |
|
| 5 | +This action checks that the commit subject is compliant with the [patch classifying rules](https://github.com/haproxy/haproxy/blob/master/CONTRIBUTING#L632) of HAProxy contribution guidelines. Also it does minimal check for a meaningful message in the commit subject: no less than 20 characters and at least 3 words. |
5 | 6 |
|
6 | | -This repository contains Github Actions used in CI/CD workflows of [HAProxy Technologies](https://www.haproxy.com/) repositories hosted in Github. |
| 7 | +## Examples |
7 | 8 |
|
8 | | -## Usage |
| 9 | +### Good |
| 10 | + |
| 11 | +- Bug fix: |
| 12 | +``` |
| 13 | +BUG/MEDIUM: fix set-var parsing bug in config-parser |
| 14 | +``` |
| 15 | +- New minor feature: |
| 16 | +``` |
| 17 | +MINOR: Add path-rewrite annotation |
| 18 | +``` |
| 19 | +- Minor build update: |
| 20 | +``` |
| 21 | +BUILD/MINOR: Add path-rewrite annotation |
| 22 | +``` |
| 23 | + |
| 24 | +### Bad |
| 25 | + |
| 26 | +- Incorrect patch type |
| 27 | +``` |
| 28 | +bug: fix set-var parsing bug in config-parser |
| 29 | +``` |
| 30 | +- Short commit message |
| 31 | +``` |
| 32 | +BUG/MEDIUM: fix set-var |
| 33 | +``` |
| 34 | +- Unkown severity |
| 35 | +``` |
| 36 | +BUG/MODERATE: fix set-var parsing bug in config-parser |
| 37 | +``` |
| 38 | + |
| 39 | + |
| 40 | +## Inputs |
9 | 41 |
|
10 | | -- Using action via Docker container image on Docker Hub: |
| 42 | +None. |
| 43 | + |
| 44 | +## Usage |
11 | 45 |
|
12 | 46 | ```yaml |
13 | 47 | steps: |
14 | | - - name: Check out code |
15 | | - uses: actions/checkout@v2 |
16 | | - - name: action-name |
17 | | - uses: docker://haproxytech/action-name:TAG |
| 48 | + - name: check-commit |
| 49 | + uses: docker://haproxytech/check-commit:TAG |
| 50 | + env: |
| 51 | + API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
18 | 52 | ``` |
| 53 | +Check-commit works only on `pull_request` events by inspecting all commit messages in a Pull Request. It uses Github API [pull requests API](https://docs.github.com/en/rest/reference/pulls#list-commits-on-a-pull-request) to fetch the commits so API_TOKEN env_variable is required. |
| 54 | + |
| 55 | +## Example configuration |
19 | 56 |
|
20 | | -- Using action via HAProxyTech repository: |
| 57 | +If a configuration file (`.check-commit.yml`) is not available in the running directory, a built-in failsafe configuration identical to the one below is used. |
21 | 58 |
|
22 | 59 | ```yaml |
23 | | -steps: |
24 | | - - name: Check out code |
25 | | - uses: actions/checkout@v2 |
26 | | - - name: action-name |
27 | | - uses: haproxytech/github-actions/action-name@TAG |
| 60 | +--- |
| 61 | +HelpText: "Please refer to https://github.com/haproxy/haproxy/blob/master/CONTRIBUTING#L632" |
| 62 | +PatchScopes: |
| 63 | + HAProxy Standard Scope: |
| 64 | + - MINOR |
| 65 | + - MEDIUM |
| 66 | + - MAJOR |
| 67 | + - CRITICAL |
| 68 | +PatchTypes: |
| 69 | + HAProxy Standard Patch: |
| 70 | + Values: |
| 71 | + - BUG |
| 72 | + - BUILD |
| 73 | + - CLEANUP |
| 74 | + - DOC |
| 75 | + - LICENSE |
| 76 | + - OPTIM |
| 77 | + - RELEASE |
| 78 | + - REORG |
| 79 | + - TEST |
| 80 | + - REVERT |
| 81 | + Scope: HAProxy Standard Scope |
| 82 | + HAProxy Standard Feature Commit: |
| 83 | + Values: |
| 84 | + - MINOR |
| 85 | + - MEDIUM |
| 86 | + - MAJOR |
| 87 | + - CRITICAL |
| 88 | +TagOrder: |
| 89 | + - PatchTypes: |
| 90 | + - HAProxy Standard Patch |
| 91 | + - HAProxy Standard Feature Commit |
28 | 92 | ``` |
| 93 | + |
| 94 | +### Optional parameters |
| 95 | + |
| 96 | +The program accepts an optional parameter to specify the location (path) of the base of the git repository. This can be useful in certain cases where the checked-out repo is in a non-standard location within the CI environment, compared to the running path from which the check-commit binary is being invoked. |
0 commit comments