From 87faa1740f09afd485bd22c3fa010e8954694ac4 Mon Sep 17 00:00:00 2001 From: Samuel Searles-Bryant Date: Mon, 1 Jun 2026 15:49:42 +0100 Subject: [PATCH 1/2] Check out SHA, not branch name For PRs opened from forks, the branch does not exist in the upstream repository, so we cannot check out the branch by name. This change references the SHA instead, which is available. Co-authored-by: Charlie Denton --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c916048..4ea0a95 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -86,7 +86,7 @@ jobs: steps: - uses: actions/checkout@v5 with: - ref: ${{ github.head_ref }} + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - run: | git fetch origin main From 416b81cb769114e70f8407234531b7b5e787ef7c Mon Sep 17 00:00:00 2001 From: Samuel Searles-Bryant Date: Mon, 1 Jun 2026 15:51:36 +0100 Subject: [PATCH 2/2] Specify `origin/main` as the base for checking commits This means we no longer need to create a local branch called `main`. Co-authored-by: Charlie Denton --- .github/workflows/tests.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4ea0a95..3a77c8f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -88,11 +88,8 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - - run: | - git fetch origin main - git branch main origin/main - uses: actions/setup-python@v6 with: python-version-file: '.github/workflows/.python-version' - run: pip install validate_commits - - run: validate-commits + - run: validate-commits --since=origin/main