diff --git a/.github/workflows/ccip-integration-test.yml b/.github/workflows/ccip-integration-test.yml index 15dc0e3e3..d8cdf90d7 100644 --- a/.github/workflows/ccip-integration-test.yml +++ b/.github/workflows/ccip-integration-test.yml @@ -32,10 +32,20 @@ jobs: cd ccip git fetch git checkout ccip-develop + - name: Get the correct commit SHA via GitHub API + id: get_sha + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + COMMIT_SHA=${{ github.event.pull_request.head.sha }} + else + COMMIT_SHA=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/commits/${{ github.ref }}" | jq -r .sha) + fi + echo "::set-output name=sha::$COMMIT_SHA" - name: Update chainlink-ccip dependency in ccip run: | cd ccip - go get github.com/smartcontractkit/chainlink-ccip@${{ github.event.pull_request.head.sha }} + go get github.com/smartcontractkit/chainlink-ccip@${{ steps.get_sha.outputs.sha }} make gomodtidy - name: Setup Postgres uses: ./.github/actions/setup-postgres