Skip to content

Commit 8a3c151

Browse files
Merge pull request #681 from XeroAPI/PETOSS-588-commitlinting-pipeline
PETOSS-588 | commit lint step added in pipeline
2 parents f1f4f35 + 800cd7a commit 8a3c151

5 files changed

Lines changed: 2432 additions & 0 deletions

File tree

.github/workflows/pr-health-check.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424

25+
- name: Set up Node environment
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Run commitlint on PR commits
34+
run: |
35+
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
36+
2537
# ***** YAML Linting steps are disabled for now *****
2638

2739

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,54 @@ In Release (used for one or more SDKs)
1616
* [Payroll NZ](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero-payroll-nz.yaml)
1717
* [Files](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero_files.yaml)
1818

19+
20+
## Contribution guide
21+
22+
:loudspeaker: Announcement for all active contributors for Xero-OpenAPI repo :loudspeaker:
23+
24+
We have enabled [commit linting](https://github.com/conventional-changelog/commitlint/#what-is-commitlint) in this repo to ensure that all commit messages follow the conventional commits standards. Please make sure your commit messages are properly formatted or the PR checks will fail. :no_entry_sign:
25+
26+
You can refer to the [conventional commits documentation](https://www.conventionalcommits.org/en/v1.0.0/#summary) for better understanding.
27+
28+
**Context:**
29+
30+
We have automated the release process in xero-OpenAPI using [semantic-release package](https://github.com/semantic-release/semantic-release). In brief this package analyses all the commits in the repo to determine the next version number, generate the release notes and publish the package, hence the commit message is important for the release to happen successfully. Please read more on the conventional commit [documentation](https://www.conventionalcommits.org/en/v1.0.0/#summary) before landing your commits, each commit message will determine the release notes !
31+
32+
33+
**Example:**
34+
35+
If your commit message is - ``feat: Added a new parameter in the get_account method`` - It will do a **minor version update**.
36+
37+
Following release notes will be generated -
38+
39+
```
40+
Release notes
41+
42+
Feature -
43+
- Added a new parameter in the get_account method
44+
```
45+
46+
If your commit message is - ``fix: fixed the null issue with get_invoice method`` - It will do a **patch version update**.
47+
48+
Following release notes will be generated -
49+
50+
```
51+
Release notes
52+
53+
Fix -
54+
- fixed the null issue with get_invoice method
55+
```
56+
57+
58+
if your commit message is as below it will do a **major version update** (Breaking change)
59+
60+
```
61+
chore!: drop support for Node 6
62+
63+
BREAKING CHANGE: use JavaScript features not available in Node 6
64+
```
65+
66+
1967
## Code Generators
2068
We are using [OpenAPI generator](https://github.com/OpenAPITools/openapi-generator) along with these OAS yaml files to generate our new SDKs.
2169

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional']
3+
}

0 commit comments

Comments
 (0)