File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments