diff --git a/.github/workflows/bench-diff.yml b/.github/workflows/bench-diff.yml index 5f6cdc05..4dfe0714 100644 --- a/.github/workflows/bench-diff.yml +++ b/.github/workflows/bench-diff.yml @@ -18,16 +18,20 @@ jobs: permissions: checks: write steps: - - name: Debug event types + - name: Get sha commit + id: event 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 }}" + echo "DEBUG: event type(${{ github.event_name }})" + if [ "${{ github.event_name != 'pull_request' }}" = "true" ] ; then + echo "ref=${{ github.sha }}" >> "$GITHUB_OUTPUT" + else + echo "ref=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT" + fi - 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 }} + ref: ${{ steps.event.outputs.ref }} - uses: actions/setup-go@v5 with: go-version-file: go.mod @@ -36,7 +40,7 @@ jobs: id: benchdiff with: benchdiff_version: 0.9.1 - status_sha: ${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }} + status_sha: ${{ steps.event.outputs.ref }} status_name: benchdiff-result status_on_degraded: neutral # See https://github.com/WillAbides/benchdiff