From b712935571355df44e126c5b27c98ccd53d1d18b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 5 Aug 2020 08:32:06 +0200 Subject: tools/check-commits.sh: fix commit range detection We currently check from github.event.pull_request.base.sha to github.event.pull_request.head.sha, but they may be in different branches if the PR commits are branched not from the latest master HEAD (at the time of PR creation). Then GH will create a merge commit, and the range we try to check is not valid. Check github.event.pull_request.commits commits backwards from github.event.pull_request.head.sha commit. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b4119e33..aab76bb79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,6 @@ jobs: with: path: gopath/src/github.com/google/syzkaller # This is needed for tools/check-commits.sh - ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 100 # Caches everything in .cache dir, in partiuclar we want to cache go-build and golangci-lint stuff. # For reference see: @@ -29,7 +28,9 @@ jobs: # Run make presubmit_smoke. - name: run env: + GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} GITHUB_PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} + GITHUB_PR_COMMITS: ${{ github.event.pull_request.commits }} run: gopath/src/github.com/google/syzkaller/.github/workflows/run.sh syz-env make presubmit_smoke # Upload coverage report to codecov.io. For reference see: # https://github.com/codecov/codecov-action/blob/master/README.md -- cgit mrf-deployment