Skip to content

Commit f91fbec

Browse files
committed
try fixing benchmark action
1 parent cb67b0e commit f91fbec

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/benchmark.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@ name: Benchmark a pull request
22

33
on:
44
pull_request:
5+
types: [opened, synchronize, edited] # Triggers on PR updates
56

67
concurrency:
7-
# Skip intermediate builds: always.
88
group: ${{ github.workflow }}-${{ github.ref }}
9-
cancel-in-progress: true # always cancel old runs on new push
9+
cancel-in-progress: true # Always cancel old runs on new pushes
1010

1111
permissions:
1212
pull-requests: write
1313
actions: write
1414
contents: read
1515

1616
jobs:
17-
check_skip: # check for "[no benchmark]" in pr body
17+
check_skip:
1818
runs-on: ubuntu-latest
1919
outputs:
2020
skip: ${{ steps.check.outputs.skip_benchmark }}
2121
steps:
2222
- name: Fetch latest PR details
2323
id: fetch-pr
2424
run: |
25-
PR_DATA=$(gh pr view ${{ github.event.pull_request.number }} --json body,title -q '{body: .body, title: .title}')
26-
echo "PR_TITLE=$(echo $PR_DATA | jq -r '.title')" >> $GITHUB_ENV
27-
echo "PR_BODY=$(echo $PR_DATA | jq -r '.body')" >> $GITHUB_ENV
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
PR_DATA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
26+
-H "Accept: application/vnd.github.v3+json" \
27+
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
28+
PR_TITLE=$(echo "$PR_DATA" | jq -r '.title')
29+
PR_BODY=$(echo "$PR_DATA" | jq -r '.body')
30+
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
31+
echo "PR_BODY=$PR_BODY" >> $GITHUB_ENV
3032
- name: Check for '[no benchmark]'
3133
id: check
3234
run: |

0 commit comments

Comments
 (0)