Skip to content

Commit

Permalink
GHA AUTHORS check: handle PRs from forks
Browse files Browse the repository at this point in the history
where the ref names differ compared to own PRs. Instead refer to the base branch and the head branch via generic HEAD^<parent number> where HEAD is a merge commit.
  • Loading branch information
Al2Klimov committed Jan 18, 2024
1 parent d6a9628 commit 82e9c71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/authors-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
sort -uo AUTHORS AUTHORS
git add AUTHORS
git log --format='format:%aN <%aE>' "$(
git merge-base "origin/$GITHUB_BASE_REF" "origin/$GITHUB_HEAD_REF"
)..origin/$GITHUB_HEAD_REF" >> AUTHORS
git merge-base HEAD^1 HEAD^2
)..HEAD^2" >> AUTHORS
sort -uo AUTHORS AUTHORS
git diff AUTHORS >> AUTHORS.diff
Expand Down

0 comments on commit 82e9c71

Please sign in to comment.