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
22
33on :
44 pull_request :
5+ types : [opened, synchronize, edited] # Triggers on PR updates
56
67concurrency :
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
1111permissions :
1212 pull-requests : write
1313 actions : write
1414 contents : read
1515
1616jobs :
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 : |
You can’t perform that action at this time.
0 commit comments