Skip to content

Commit e098aac

Browse files
committed
Fix coverage badge push: copy SVG to tmp before branch switch
1 parent 248f05c commit e098aac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ jobs:
7070
- name: Push badge to badges branch
7171
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
7272
run: |
73+
# Save badge outside the working tree
74+
cp coverage-badge.svg /tmp/coverage-badge.svg
7375
git config user.name "github-actions[bot]"
7476
git config user.email "github-actions[bot]@users.noreply.github.com"
75-
# Create or update the badges branch
7677
git checkout --orphan badges-tmp
7778
git rm -rf .
78-
mv coverage-badge.svg .
79+
cp /tmp/coverage-badge.svg coverage-badge.svg
7980
git add coverage-badge.svg
8081
git commit -m "Update coverage badge: ${{ env.COVERAGE }}%"
8182
git push origin HEAD:badges --force

0 commit comments

Comments
 (0)