diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6b6db2..8f0e5bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,13 +18,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 + # For pull_request events, default checkout is a merge commit which may not be conventional. + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} - name: Check commit messages uses: cocogitto/cocogitto-action@v4 with: command: check + # Only lint the commits introduced by this PR/push, not the entire repo history. + args: ${{ github.event_name == 'pull_request' && format('{0}..{1}', github.event.pull_request.base.sha, github.event.pull_request.head.sha) || format('{0}..{1}', github.event.before, github.sha) }} check: name: Lint and Typecheck @@ -32,7 +36,7 @@ jobs: needs: commitlint steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Bun uses: oven-sh/setup-bun@v2 with: @@ -48,7 +52,7 @@ jobs: needs: commitlint steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Bun uses: oven-sh/setup-bun@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6b41b3..1d1bee3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Generate changelog