From a521826896bc923767401b905f49348b895cc20a Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 2 Mar 2022 19:50:42 +0100 Subject: [PATCH] Fix pull request refs --- .github/workflows/go.yml | 13 ++++++++----- .github/workflows/horizon.yml | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index cd3abe6d8b..8c5a913557 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,7 +14,10 @@ jobs: go: [1.17, 1.18.0-rc1] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + # For pull requests, build and test the PR head not a merge of the PR with the destination. + ref: ${{ ( github.event.pull_request.head.sha || github.ref }} - uses: ./.github/actions/setup-go with: go-version: ${{ matrix.go }} @@ -31,10 +34,10 @@ jobs: go: [1.17, 1.16.7, 1.18.0-rc1] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # For pull requests, build and test the PR head not a merge of the PR with the destination. - ref: ${{ github.head_ref || github.ref }} + ref: ${{ ( github.event.pull_request.head.sha || github.ref }} - uses: ./.github/actions/setup-go with: go-version: ${{ matrix.go }} @@ -79,10 +82,10 @@ jobs: REDIS_HOST: localhost REDIS_PORT: 6379 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # For pull requests, build and test the PR head not a merge of the PR with the destination. - ref: ${{ github.head_ref || github.ref }} + ref: ${{ github.event.pull_request.head.sha || github.ref }} # We need to full history for git-restore-mtime to know what modification dates to use. # Otherwise, the Go test cache will fail (due to the modification time of fixtures changing). fetch-depth: '0' diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 1ae2f1e27b..b4a08acf4d 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -39,10 +39,10 @@ jobs: PGPASSWORD: postgres PGDATABASE: postgres steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # For pull requests, build and test the PR head not a merge of the PR with the destination. - ref: ${{ github.head_ref || github.ref }} + ref: ${{ github.event.pull_request.head.sha || github.ref }} # We need to full history for git-restore-mtime to know what modification dates to use. # Otherwise, the Go test cache will fail (due to the modification time of fixtures changing). fetch-depth: '0' @@ -74,10 +74,10 @@ jobs: name: Test (and push) verify-range image runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # For pull requests, build and test the PR head not a merge of the PR with the destination. - ref: ${{ github.head_ref || github.ref }} + ref: ${{ github.event.pull_request.head.sha || github.ref }} - name: Build and test the Verify Range Docker image run: |