From 82e9c71001d2290f5626dbb7ef8ee682795b750b Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 18 Jan 2024 17:22:35 +0100 Subject: [PATCH] GHA AUTHORS check: handle PRs from forks where the ref names differ compared to own PRs. Instead refer to the base branch and the head branch via generic HEAD^ where HEAD is a merge commit. --- .github/workflows/authors-file.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/authors-file.yml b/.github/workflows/authors-file.yml index 3970aee681d..9e13ab6862a 100644 --- a/.github/workflows/authors-file.yml +++ b/.github/workflows/authors-file.yml @@ -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