diff --git a/.github/workflows/bench-diff.yml b/.github/workflows/bench-diff.yml index 0c389831..df5647cb 100644 --- a/.github/workflows/bench-diff.yml +++ b/.github/workflows/bench-diff.yml @@ -13,14 +13,21 @@ jobs: # Support for branches, non-forked-prs or forked-prs with a label if: | contains(github.event.pull_request.labels.*.name, 'safe-to-test') || - github.event_name != 'pull_request' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false + github.event_name != 'pull_request' || + (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) permissions: checks: write steps: + - name: Debug event types + run: | + echo "${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}" + echo "github.sha=${{ github.sha }}" + echo "github.event.pull_request.head.sha=${{ github.event.pull_request.head.sha }}" - uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false + ref: ${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }} - uses: actions/setup-go@v5 with: go-version-file: go.mod @@ -29,7 +36,7 @@ jobs: id: benchdiff with: benchdiff_version: 0.9.1 - status_sha: ${{ github.sha }} + status_sha: ${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }} status_name: benchdiff-result status_on_degraded: neutral # See https://github.com/WillAbides/benchdiff