chore: update pull request template #1496
Workflow file for this run
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: cohort360-frontend-commitlint | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| - main | |
| types: [opened, synchronize, reopened, ready_for_review, edited] | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| commit-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install commit-lint | |
| run: | | |
| npm install --ignore-scripts --force conventional-changelog-conventionalcommits @commitlint/config-conventional commitlint@latest | |
| - name: Fix commitlint error | |
| run: | | |
| sed -i 's/"type": "module",//g' package.json | |
| - name: Validate PR commits with commitlint | |
| env: | |
| BASE_REF: ${{ github.event.pull_request.base.ref }} | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| run: | | |
| git fetch origin "$BASE_REF" | |
| FROM=$(git merge-base "origin/$BASE_REF" "$HEAD_SHA") | |
| npx commitlint --from "$FROM" --to "$HEAD_SHA" --verbose | |
| - name: Validate PR title with commitlint | |
| run: | | |
| echo "${{ github.event.pull_request.title }}" | npx commitlint |