From 6e1f20d4450ec224bae1963a0ad5c71845527b2f Mon Sep 17 00:00:00 2001 From: Erik Holum Date: Mon, 21 Oct 2024 11:54:05 -0400 Subject: [PATCH] Fetch history for the PR ref instead of relying on the origin (issue #3) --- action.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index fc7f604..ec5d2b1 100644 --- a/action.yaml +++ b/action.yaml @@ -8,11 +8,15 @@ runs: run: git fetch --unshallow shell: bash + - name: Support forks by grabbing the commit history from the PR branch + run: git fetch origin pull/${{ github.event.number }}/head:updated_head_ref + shell: bash + - name: Check that every commit name includes an issue reference like "#1" run: | set -eo pipefail IFS=$'\n' - commits=$(git log --oneline origin/${{github.base_ref}}..origin/${{github.head_ref}}) + commits=$(git log --oneline origin/${{github.base_ref}}..updated_head_ref) for commit in $commits do if [[ $commit =~ ^.*#[0-9]+.*$ ]];