ci: replaced manual SemVer with Release Please #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Commitlint | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["**"] | |
| jobs: | |
| commitlint: | |
| name: Lint commit messages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| # Fetch enough history so commitlint can walk back to the base commit. | |
| # For PRs this fetches the full branch; for pushes it fetches the | |
| # commits introduced by the push event. | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "lts/*" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| # On a pull_request event, lint every commit in the PR. | |
| # On a push event, lint every commit that was just pushed. | |
| - name: Lint commits (pull_request) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| npx commitlint \ | |
| --from "${{ github.event.pull_request.base.sha }}" \ | |
| --to "${{ github.event.pull_request.head.sha }}" \ | |
| --verbose | |
| - name: Lint commits (push) | |
| if: github.event_name == 'push' | |
| run: | | |
| npx commitlint \ | |
| --from "${{ github.event.before }}" \ | |
| --to "${{ github.event.after }}" \ | |
| --verbose | |