Skip to content

Commit adbe6b6

Browse files
committed
fix ci
1 parent afa0f47 commit adbe6b6

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,28 @@ name: Benchmark
22

33
on:
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+
819
jobs:
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
@@ -75,5 +88,18 @@ jobs:
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

0 commit comments

Comments
 (0)