Skip to content

Commit f1e7de5

Browse files
committed
fix: 🩹 fix issues with making gh-pages commit
1 parent 9cfffb0 commit f1e7de5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ runs:
117117
if: inputs.make-badges == 'true' && inputs.upload-badges-to-pages == 'true'
118118
shell: bash
119119
run: |
120+
# Check if badges were generated
121+
if [ ! -d "badges" ] || [ ! -f "badges/coverage.json" ]; then
122+
echo "⚠️ No badges found to upload. Skipping GitHub Pages upload."
123+
exit 0
124+
fi
125+
120126
# Configure git
121127
git config --local user.email "[email protected]"
122128
git config --local user.name "GitHub Action"
@@ -128,8 +134,12 @@ runs:
128134
git pull origin ${{ inputs.pages-branch }}
129135
else
130136
echo "🆕 Creating new ${{ inputs.pages-branch }} branch from current branch"
137+
# Save badges to temporary location before cleanup
138+
cp -r badges /tmp/badges-backup
131139
git checkout --orphan ${{ inputs.pages-branch }}
132140
git rm -rf . || true
141+
# Restore badges after cleanup
142+
cp -r /tmp/badges-backup badges
133143
fi
134144
135145
# Create the badges directory

0 commit comments

Comments
 (0)