Skip to content

Commit

Permalink
Merge pull request #681 from XeroAPI/PETOSS-588-commitlinting-pipeline
Browse files Browse the repository at this point in the history
PETOSS-588  | commit lint step added in pipeline
  • Loading branch information
sangeet-joy-tw authored Oct 18, 2024
2 parents f1f4f35 + 800cd7a commit 8a3c151
Show file tree
Hide file tree
Showing 5 changed files with 2,432 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/pr-health-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ jobs:
with:
fetch-depth: 0

- name: Set up Node environment
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm ci

- name: Run commitlint on PR commits
run: |
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
# ***** YAML Linting steps are disabled for now *****


Expand Down
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,54 @@ In Release (used for one or more SDKs)
* [Payroll NZ](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero-payroll-nz.yaml)
* [Files](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero_files.yaml)


## Contribution guide

:loudspeaker: Announcement for all active contributors for Xero-OpenAPI repo :loudspeaker:

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:

You can refer to the [conventional commits documentation](https://www.conventionalcommits.org/en/v1.0.0/#summary) for better understanding.

**Context:**

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 !


**Example:**

If your commit message is - ``feat: Added a new parameter in the get_account method`` - It will do a **minor version update**.

Following release notes will be generated -

```
Release notes
Feature -
- Added a new parameter in the get_account method
```

If your commit message is - ``fix: fixed the null issue with get_invoice method`` - It will do a **patch version update**.

Following release notes will be generated -

```
Release notes
Fix -
- fixed the null issue with get_invoice method
```


if your commit message is as below it will do a **major version update** (Breaking change)

```
chore!: drop support for Node 6
BREAKING CHANGE: use JavaScript features not available in Node 6
```


## Code Generators
We are using [OpenAPI generator](https://github.com/OpenAPITools/openapi-generator) along with these OAS yaml files to generate our new SDKs.

Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
}
Loading

0 comments on commit 8a3c151

Please sign in to comment.