Skip to content

Commit

Permalink
Fetch history for the PR ref instead of relying on the origin (issue #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
eholum committed Oct 21, 2024
1 parent 7ae0819 commit 6e1f20d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]+.*$ ]];
Expand Down

0 comments on commit 6e1f20d

Please sign in to comment.