Skip to content

Commit 1f4a592

Browse files
authored
Merge pull request #42 from MDA2AV/fix/benchmark-pr-workflow
ci: push benchmark results via PR instead of direct push
2 parents a9557ab + 69b73fa commit 1f4a592

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818

1919
permissions:
2020
contents: write
21+
pull-requests: write
2122

2223
concurrency:
2324
group: benchmark
@@ -53,13 +54,22 @@ jobs:
5354
./scripts/benchmark.sh --save "$fw" ${{ inputs.profile }} || echo "WARN: $fw benchmark failed"
5455
done
5556
56-
- name: Commit and push results
57+
- name: Create PR with results
5758
if: steps.detect.outputs.list != ''
59+
env:
60+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5861
run: |
5962
git config user.name "HttpArena Bot"
6063
git config user.email "bot@httparena"
6164
git add site/data/ site/static/logs/ 2>/dev/null || true
6265
if ! git diff --cached --quiet; then
66+
branch="benchmark-results/$(date +%Y%m%d-%H%M%S)"
67+
git checkout -b "$branch"
6368
git commit -m "benchmark: update results for ${{ steps.detect.outputs.list }}"
64-
git push
69+
git push -u origin "$branch"
70+
gh pr create \
71+
--title "benchmark: update results for ${{ steps.detect.outputs.list }}" \
72+
--body "Automated benchmark results update." \
73+
--base main \
74+
--head "$branch"
6575
fi

0 commit comments

Comments
 (0)