diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 00000000..477f4ad8 --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,38 @@ +{ + "extends": [ + "@commitlint/config-conventional" + ], + "rules": { + "type-enum": [ + 2, + "always", + [ + "build", + "ci", + "core", + "csi", + "doc", + "docs", + "mds", + "mgr", + "mon", + "operator", + "osd", + "test", + "tests" + ] + ], + "body-leading-blank": [ + 2, + "always" + ], + "footer-leading-blank": [ + 2, + "always" + ], + "body-max-line-length": [ + 0, + "always" + ] + } +} diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..07956c9f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ + + +**Description of your changes:** + +**Which issue is resolved by this Pull Request:** +Resolves # + +**Checklist:** + +- [ ] **Commit Message Formatting**: Commit titles and messages follow guidelines in the [developer guide](https://rook.io/docs/rook/latest/Contributing/development-flow/#commit-structure). +- [ ] Reviewed the developer guide on [Submitting a Pull Request](https://rook.io/docs/rook/latest/Contributing/development-flow/#submitting-a-pull-request) +- [ ] CI tests has been updated, if necessary. +- [ ] Documentation has been updated, if necessary. +- [ ] Unit tests have been added, if necessary. diff --git a/.github/commitlint.yaml b/.github/commitlint.yaml new file mode 100644 index 00000000..216d12a2 --- /dev/null +++ b/.github/commitlint.yaml @@ -0,0 +1,37 @@ +name: Commitlint +on: + push: + tags: + - v* + branches: + - master + - release-* + pull_request: + branches: + - master + - release-* + +# cancel the in-progress workflow when PR is refreshed. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + lint: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: read # for wagoid/commitlint-github-action to get commits in PR + runs-on: ubuntu-20.04 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: wagoid/commitlint-github-action@v5.4.3 + with: + configFile: "./.commitlintrc.json" + helpURL: https://rook.io/docs/rook/latest/Contributing/development-flow/#commit-structure