fix: git message

This commit is contained in:
Alter-xyz
2025-05-18 00:11:57 +08:00
parent 0bae360457
commit f8da9ed2f8
3 changed files with 14 additions and 30 deletions

View File

@@ -52,15 +52,22 @@ jobs:
run: |
# Check if there are file changes
if [[ -n "$(git status --porcelain)" ]]; then
# Use commit message from script output, or default if not available
COMMIT_MESSAGE="${{ steps.doc-tools.outputs.commit_message || 'Documentation tools automatic execution' }}"
FIXED_COMMIT_SUBJECT="Docs: Automated documentation updates"
COMMIT_DESCRIPTION=""
if [[ -n "${{ steps.doc-tools.outputs.commit_message }}" ]]; then
COMMIT_DESCRIPTION="${{ steps.doc-tools.outputs.commit_message }}"
else
COMMIT_DESCRIPTION="Automated processing of documentation files."
fi
git config --local user.email "88554920+alterxyz@users.noreply.github.com"
git config --local user.name "alterxyz"
git add .
git commit -m "$COMMIT_MESSAGE" || echo "No changes to commit"
git commit -m "$FIXED_COMMIT_SUBJECT" -m "$COMMIT_DESCRIPTION" || echo "No changes to commit"
git push
echo "Changes committed: $COMMIT_MESSAGE"
echo "Changes committed with subject: $FIXED_COMMIT_SUBJECT"
echo "Description: $COMMIT_DESCRIPTION"
else
echo "No file changes, skipping commit"
fi