diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index c524221d8..db1972af8 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -31,9 +31,20 @@ jobs: version: ${{ steps.vars.outputs.version }} clustername: ${{ steps.vars.outputs.clustername }} steps: + - name: Get PR ref + uses: actions/github-script@v6 + id: pr + with: + script: | + const { data: pullRequest } = await github.rest.pulls.get({ + ...context.repo, + pull_number: context.payload.pull_request.number, + }); + return pullRequest - name: Checkout repository uses: actions/checkout@v4 with: + ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}} fetch-depth: 0 - name: Setup Go uses: actions/setup-go@v5