fix(ci): test on npm@12 #82
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: Lint Commits | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| jobs: | |
| lint-pr-first-commit: | |
| name: Commit Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 22.x | |
| - run: npm install --global npm@12 | |
| - run: npm install | |
| - name: Lint first PR commit message | |
| run: | | |
| FIRST=$(git rev-list --reverse ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | head -1) | |
| echo "Base: ${{ github.event.pull_request.base.sha }}" | |
| echo "Head: ${{ github.event.pull_request.head.sha }}" | |
| echo "First PR commit: $FIRST" | |
| git log -1 --format=%B "$FIRST" | npx commitlint --verbose |