From 564f5c1e58ae265190af5300a07a32996f135c88 Mon Sep 17 00:00:00 2001 From: Felisia Martini Date: Thu, 3 Jun 2021 12:52:50 +0100 Subject: [PATCH] Checkout the right branch depending on event --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6971a4..436dcb2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,12 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ matrix.version }} - - uses: actions/checkout@v2 + - if: ${{ github.event_name == 'pull_request_target' }} + uses: actions/checkout@v2 + with: + ref: ${{ format('refs/pull/{0}/merge', github.event.number) }} + - if: ${{ github.event_name == 'push' }} + uses: actions/checkout@v2 - run: ./scripts/run-tests.sh automerge: needs: test