diff --git a/.commitlintrc.yml b/.commitlintrc.yml new file mode 100644 index 0000000..58f3449 --- /dev/null +++ b/.commitlintrc.yml @@ -0,0 +1,7 @@ +extends: + - '@commitlint/config-conventional' + +rules: + 'header-max-length': [2, 'always', 50] + 'body-max-line-length': [2, 'always', 72] + 'type-enum': [2, 'always', ['feat', 'fix', 'perf', 'refactor', 'test', 'docs', 'ci', 'build', 'chore', 'revert']] diff --git a/.gitcommit b/.gitcommit new file mode 100644 index 0000000..40d9553 --- /dev/null +++ b/.gitcommit @@ -0,0 +1,8 @@ +# :
+ +# Explain what & why, wrapped at 72 characters per line. +# Focus on rationale and intent, not implementation details. + +# Footer: use only if needed. +# - BREAKING CHANGE: describe incompatible change +# - Other important notes (e.g. migration, deprecation) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 854cc53..1cd3385 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,25 @@ on: - pull_request jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: npm + - name: Lint branch commits with commitlint + if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + run: | + npm install -g @commitlint/config-conventional @commitlint/cli + commitlint --verbose \ + --from $(git merge-base origin/${{ github.event.repository.default_branch }} ${{ github.sha }}) \ + --to ${{ github.sha }} + test: runs-on: ubuntu-latest steps: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..5e33c9d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,42 @@ +# Contributing to MIRACL Trust Client JS Library + +## Git Commit Policy + +> Concise rules for this repository. +> Details: +### Format + +```txt +: + +