Skip to content

Commit d69be15

Browse files
committed
add origin
1 parent 8455393 commit d69be15

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/git-commit-checks.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,15 @@ def _is_entirely_submodule_updates(repo, commit):
294294
#----------------------------------------------------------------------------
295295

296296
def check_all_commits(config, repo):
297-
# Get a list of commits that we'll be examining. Use the programmatic form
297+
# Get a list of commits that we'll be examining. Use the programmatic form
298298
# of "git log GITHUB_BASE_REF..GITHUB_HEAD_REF" (i.e., "git log
299299
# ^GITHUB_BASE_REF GITHUB_HEAD_REF") to do the heavy lifting to find that
300-
# set of commits.
300+
# set of commits. Because we're using pull_request_target, GITHUB_BASE_REF
301+
# is already checked out. GITHUB_HEAD_REF has never been checked out, so we
302+
# specify "origin/{GITHUB_HEAD_REF}".
301303
git_cli = git.cmd.Git(GITHUB_WORKSPACE)
302304
hashes = git_cli.log(f"--pretty=format:%h",
303-
f"{GITHUB_BASE_REF}..{GITHUB_HEAD_REF}").splitlines()
305+
f"{GITHUB_BASE_REF}..origin/{GITHUB_HEAD_REF}").splitlines()
304306

305307
#------------------------------------------------------------------------
306308

0 commit comments

Comments
 (0)