File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,15 +2,28 @@ name: Benchmark
22
33on :
44 push :
5+ branches :
6+ - main
7+ paths-ignore :
8+ - README.md
59 pull_request :
10+ branches :
11+ - main
12+ paths-ignore :
13+ - README.md
614 workflow_dispatch :
715
16+ permissions :
17+ contents : write
18+
819jobs :
920 benchmark :
1021 runs-on : ubuntu-24.04
1122
1223 steps :
1324 - uses : actions/checkout@v4
25+ with :
26+ fetch-depth : 0
1427 - uses : oven-sh/setup-bun@v2
1528
1629 - name : Install dependencies
7588
7689 mv "$tmp_readme" README.md
7790
78- echo "Updated README benchmark block:"
79- sed -n '/<!-- benchmark:start -->/,/<!-- benchmark:end -->/p' README.md
91+ - name : Commit and push README update
92+ if : github.event_name != 'pull_request'
93+ run : |
94+ set -euo pipefail
95+
96+ if git diff --quiet -- README.md; then
97+ echo "README.md is unchanged"
98+ exit 0
99+ fi
100+
101+ git config user.name "github-actions[bot]"
102+ git config user.email "github-actions[bot]@users.noreply.github.com"
103+ git add README.md
104+ git commit -m "update benchmark results"
105+ git push
You can’t perform that action at this time.
0 commit comments