From 9a4c8ba2afb26375ab5aff3a287bcb2cd519c5cd Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 10 Aug 2020 13:23:07 +0200 Subject: [PATCH 1/2] Fix "Check for source changes (pull_request)" GH Action job On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch. --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5649a6670e75f5..17cefeccc35159 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,15 @@ jobs: echo '::set-output name=run_tests::true' else git fetch origin $GITHUB_BASE_REF --depth=1 - git diff --name-only origin/$GITHUB_BASE_REF... | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true + # git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more reliable, + # but it requires to download more commits. + # + # git diff "origin/$GITHUB_BASE_REF.." (2 dots) should be enough on + # GitHub, since GitHub starts by merging origin/$GITHUB_BASE_REF + # into the PR branch anyway. + # + # https://github.com/python/core-workflow/issues/373 + git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true fi build_win32: name: 'Windows (x86)' From e21df38417c754d90320ae947ed8f061b8137d68 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 10 Aug 2020 13:29:48 +0200 Subject: [PATCH 2/2] Complete the comment --- .github/workflows/build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17cefeccc35159..df68fe271de7a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,8 +32,13 @@ jobs: echo '::set-output name=run_tests::true' else git fetch origin $GITHUB_BASE_REF --depth=1 - # git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more reliable, - # but it requires to download more commits. + # git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more + # reliable than git diff "origin/$GITHUB_BASE_REF.." (2 dots), + # but it requires to download more commits (this job uses + # "git fetch --depth=1"). + # + # git diff "origin/$GITHUB_BASE_REF..." (3 dots) works with Git + # 2.26, but Git 2.28 is stricter and fails with "no merge base". # # git diff "origin/$GITHUB_BASE_REF.." (2 dots) should be enough on # GitHub, since GitHub starts by merging origin/$GITHUB_BASE_REF