Skip to content

Commit 69ca81b

Browse files
committed
only commit performance test if on main branch
1 parent e9a3099 commit 69ca81b

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

.github/workflows/performance-test.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,10 @@ jobs:
226226
cat performance.md >> $GITHUB_STEP_SUMMARY
227227
228228
- name: Commit and Push Performance Report
229-
if: always()
229+
if: always() && github.ref == 'refs/heads/main'
230230
run: |
231231
git config --local user.email "action@github.com"
232232
git config --local user.name "GitHub Action"
233-
BRANCH="${{ github.head_ref || github.ref_name }}"
234-
# Fetch latest branch, reset to it, then apply only performance.md
235-
cp performance.md /tmp/performance.md
236-
git fetch origin "$BRANCH"
237-
git reset --hard "origin/$BRANCH"
238-
cp /tmp/performance.md performance.md
239233
git add performance.md
240234
git diff --staged --quiet || git commit -m "Update performance test results [skip ci]"
241-
git push origin HEAD:"$BRANCH" || echo "Push failed — performance report not updated"
235+
git push origin HEAD:main

0 commit comments

Comments
 (0)