fix: resolve YAML syntax errors in update-n8n-deps workflow

- Fixed multi-line commit message handling using proper heredoc syntax
- Replaced direct variable expansion in YAML strings with proper shell substitution
- Fixed GitHub output handling for PR body update summary
- Ensured consistent indentation throughout the workflow

The workflow was failing due to improper handling of multi-line strings
with variable expansion in YAML. Now using heredoc with placeholder
substitution for commit messages and proper GITHUB_OUTPUT syntax for
passing data between steps.
This commit is contained in:
czlonkowski
2025-06-16 16:14:10 +02:00
parent 3e037898c8
commit b2cd092ef6

View File

@@ -100,14 +100,31 @@ jobs:
# Get update summary (file is written by the update script) # Get update summary (file is written by the update script)
UPDATE_SUMMARY=$(cat update-summary.txt 2>/dev/null || echo "Updated n8n dependencies") UPDATE_SUMMARY=$(cat update-summary.txt 2>/dev/null || echo "Updated n8n dependencies")
# Commit changes # Create commit message using heredoc
git commit -m "chore: update n8n dependencies COMMIT_MSG=$(cat <<'COMMIT_EOF'
chore: update n8n dependencies
$UPDATE_SUMMARY
🤖 Automated dependency update"
${UPDATE_SUMMARY}
🤖 Automated dependency update
COMMIT_EOF
)
# Replace placeholder with actual summary
COMMIT_MSG="${COMMIT_MSG//\${UPDATE_SUMMARY}/$UPDATE_SUMMARY}"
git commit -m "$COMMIT_MSG"
git push origin $BRANCH_NAME git push origin $BRANCH_NAME
# Save update summary as output for PR
{
echo 'UPDATE_SUMMARY<<EOF'
if [ -f update-summary.txt ]; then
cat update-summary.txt
else
echo "See commit for details"
fi
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: Create Pull Request - name: Create Pull Request
if: steps.branch.outputs.branch_name != '' if: steps.branch.outputs.branch_name != ''
@@ -123,7 +140,7 @@ $UPDATE_SUMMARY
### 📦 Updates ### 📦 Updates
``` ```
$(cat update-summary.txt || echo "See commit for details") ${{ steps.update.outputs.UPDATE_SUMMARY }}
``` ```
### ✅ Validation ### ✅ Validation
@@ -194,11 +211,19 @@ $UPDATE_SUMMARY
# Get update summary # Get update summary
UPDATE_SUMMARY=$(cat update-summary.txt || echo "Updated n8n dependencies") UPDATE_SUMMARY=$(cat update-summary.txt || echo "Updated n8n dependencies")
git commit -m "chore: update n8n dependencies # Create commit message using heredoc
COMMIT_MSG=$(cat <<'COMMIT_EOF'
$UPDATE_SUMMARY chore: update n8n dependencies
🤖 Automated dependency update" ${UPDATE_SUMMARY}
🤖 Automated dependency update
COMMIT_EOF
)
# Replace placeholder with actual summary
COMMIT_MSG="${COMMIT_MSG//\${UPDATE_SUMMARY}/$UPDATE_SUMMARY}"
git commit -m "$COMMIT_MSG"
git push git push
else else