Skip Docs push if no changes (#15675)

pull/15657/head^2
Glenn Jocher 6 months ago committed by GitHub
parent 3b14816eb2
commit 5624a4a95f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      .github/workflows/docs.yml

@ -76,6 +76,10 @@ jobs:
cp -R ../site/* .
echo "$INDEXNOW_KEY" > "$INDEXNOW_KEY.txt"
git add .
LATEST_HASH=$(git rev-parse --short=7 HEAD)
git commit -m "Update Docs for 'ultralytics ${{ steps.check_pypi.outputs.version }} - $LATEST_HASH'"
git push https://$PERSONAL_ACCESS_TOKEN@github.com/ultralytics/docs.git gh-pages
if git diff --staged --quiet; then
echo "No changes to commit"
else
LATEST_HASH=$(git rev-parse --short=7 HEAD)
git commit -m "Update Docs for 'ultralytics ${{ steps.check_pypi.outputs.version }} - $LATEST_HASH'"
git push https://$PERSONAL_ACCESS_TOKEN@github.com/ultralytics/docs.git gh-pages
fi

Loading…
Cancel
Save