Skip to content

Commit

Permalink
github-action: support pull_request_target and pull_request events (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Feb 5, 2024
1 parent 31c8fb2 commit 575dc0d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/bench-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ 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)
! startsWith(github.event_name, 'pull_request') ||
(startsWith(github.event_name, 'pull_request') && github.event.pull_request.head.repo.fork == false)
permissions:
checks: write
steps:
- name: Get sha commit
id: event
run: |
echo "DEBUG: event type(${{ github.event_name }})"
if [ "${{ github.event_name != 'pull_request_target' }}" = "true" ] ; then
echo "ref=${{ github.sha }}" >> "$GITHUB_OUTPUT"
else
echo "ref=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
ref="${{ github.sha }}"
if [ "${{ startsWith(github.event_name, 'pull_request') }}" = "true" ] ; then
ref="${{ github.event.pull_request.head.sha }}"
fi
echo "ref=${ref}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Version: https://github.com/WillAbides/benchdiff-action/releases/tag/v0.3.3
# Version: https://github.com/WillAbides/benchdiff-action/releases/tag/v0.3.5
- uses: WillAbides/benchdiff-action@990b4c50b5420b485bf87e42c9f18234eba76fbc
id: benchdiff
with:
Expand Down

0 comments on commit 575dc0d

Please sign in to comment.