chore: update OpenAPI sync workflow to always commit changes

- Modified the workflow to always commit the OpenAPI specification to the website repository, even if no changes are detected.
- Enhanced the copy command to force overwrite the existing openapi.json file.
- Improved commit message formatting by allowing empty commits to ensure consistency in the sync process.
This commit is contained in:
Mauricio Siu
2025-11-30 00:56:55 -06:00
parent 8728d4b600
commit 0f632e3f55

View File

@@ -49,25 +49,21 @@ jobs:
cd website-repo
# Copia el openapi.json al website
# Copia el openapi.json al website (sobrescribe)
mkdir -p public
cp ../openapi.json public/openapi.json
cp -f ../openapi.json public/openapi.json
# Configura git
git config user.name "Dokploy Bot"
git config user.email "bot@dokploy.com"
# Verifica si hay cambios
if git diff --quiet public/openapi.json; then
echo "📝 No changes detected in website repo"
exit 0
fi
# Commitea y pushea
# Agrega y commitea siempre
git add public/openapi.json
git commit -m "chore: sync OpenAPI specification [skip ci]" \
-m "Source: ${{ github.repository }}@${{ github.sha }}" \
-m "Updated: $(date -u +'%Y-%m-%d %H:%M:%S UTC')"
-m "Updated: $(date -u +'%Y-%m-%d %H:%M:%S UTC')" \
--allow-empty
git push
echo "✅ OpenAPI synced to website successfully"