File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,22 +201,20 @@ jobs:
201201 run : touch docs/.nojekyll
202202
203203 - name : Commit and push to main
204+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
204205 run : |
205206 git config --local user.email "action@github.com"
206207 git config --local user.name "GitHub Action"
207-
208- # Add files that exist
208+
209209 git add docs/ || echo "No docs directory to add"
210-
211- # Only add data files if they exist
210+
212211 if [ -f data/community_stats.json ]; then
213212 git add data/community_stats.json
214213 fi
215-
216- # Only commit if there are changes
214+
217215 if ! git diff --staged --quiet; then
218216 git commit -m "Deploy Hugo site to docs/ [skip ci]"
219- git push
217+ git push origin HEAD:main
220218 else
221219 echo "No changes to commit"
222220 fi
You can’t perform that action at this time.
0 commit comments