release: 1.1.0 #24
This file contains 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: Validate | |
on: | |
push: | |
branches: [main, canary] | |
pull_request: | |
branches: [main, canary] | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set Git fetch depth | |
run: echo "CHECKOUT_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
# We fetch all PR commits to lint them. | |
fetch-depth: ${{ env.CHECKOUT_FETCH_DEPTH }} | |
- name: Setup Environment | |
uses: ./.github/actions/setup-environment | |
- name: Lint PR commits | |
if: github.event_name == 'pull_request' | |
run: pnpm commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} | |
- name: Validate code format | |
run: pnpm format:check | |
- name: Lint code | |
run: pnpm lint |