Skip to content

Commit

Permalink
fix: only check commits from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Jan 27, 2025
1 parent 04a8ff6 commit 67fe15c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth:
ref: ${{ github.event.pull_request.head.ref }} # Checkout the branch of the PR.
repository: ${{ github.event.pull_request.head.repo.full_name }} # Handles forks.
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
Expand All @@ -26,5 +24,11 @@ jobs:
python -m pip install --upgrade pip
pip install -r cz-requirement.txt
- name: Get base and head commits
id: commits
run: |
echo "BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} HEAD)" >> $GITHUB_ENV
echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Check commit history
run: cz check --rev-range $(git rev-list --all --reverse | head -1)..HEAD
run: cz check --rev-range $BASE_SHA..$HEAD_SHA

0 comments on commit 67fe15c

Please sign in to comment.