File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -2,31 +2,33 @@ name: Benchmark a pull request
2
2
3
3
on :
4
4
pull_request :
5
+ types : [opened, synchronize, edited] # Triggers on PR updates
5
6
6
7
concurrency :
7
- # Skip intermediate builds: always.
8
8
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
10
10
11
11
permissions :
12
12
pull-requests : write
13
13
actions : write
14
14
contents : read
15
15
16
16
jobs :
17
- check_skip : # check for "[no benchmark]" in pr body
17
+ check_skip :
18
18
runs-on : ubuntu-latest
19
19
outputs :
20
20
skip : ${{ steps.check.outputs.skip_benchmark }}
21
21
steps :
22
22
- name : Fetch latest PR details
23
23
id : fetch-pr
24
24
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
30
32
- name : Check for '[no benchmark]'
31
33
id : check
32
34
run : |
You can’t perform that action at this time.
0 commit comments