Skip to content

Commit 539df6d

Browse files
committed
Only store main branch bench results
Only store benchmark results from commits to main. This will allow actual comparisons to PRs to happen.
1 parent 8fdaf68 commit 539df6d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/bench.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Benchmark
22

33
on:
44
pull_request:
5+
push:
6+
branches: [main]
57

68
permissions:
79
contents: write
@@ -23,13 +25,14 @@ jobs:
2325
pip install .[dev]
2426
pytest tests/bench.py --benchmark-json benchmark.json
2527
26-
- name: Store results
28+
- name: Report results
2729
uses: benchmark-action/github-action-benchmark@v1
2830
with:
2931
name: Python Benchmarks
3032
tool: pytest
3133
output-file-path: benchmark.json
3234
github-token: ${{ secrets.GITHUB_TOKEN }}
33-
auto-push: true
35+
# Only update results if they are from main
36+
auto-push: ${{ github.ref == 'refs/heads/main' }}
3437
alert-threshold: "110%"
3538
comment-on-alert: true

0 commit comments

Comments
 (0)