From b2cd092ef69f7ff5023ec1f17bc3d92993b5204b Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Mon, 16 Jun 2025 16:14:10 +0200 Subject: [PATCH] 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. --- .github/workflows/update-n8n-deps.yml | 49 ++++++++++++++++++++------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/.github/workflows/update-n8n-deps.yml b/.github/workflows/update-n8n-deps.yml index 878d24e..838b34b 100644 --- a/.github/workflows/update-n8n-deps.yml +++ b/.github/workflows/update-n8n-deps.yml @@ -100,14 +100,31 @@ jobs: # Get update summary (file is written by the update script) UPDATE_SUMMARY=$(cat update-summary.txt 2>/dev/null || echo "Updated n8n dependencies") - # Commit changes - git commit -m "chore: update n8n dependencies - -$UPDATE_SUMMARY - -🤖 Automated dependency update" + # Create commit message using heredoc + COMMIT_MSG=$(cat <<'COMMIT_EOF' + chore: update n8n dependencies + ${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 + + # Save update summary as output for PR + { + echo 'UPDATE_SUMMARY<> $GITHUB_OUTPUT - name: Create Pull Request if: steps.branch.outputs.branch_name != '' @@ -123,7 +140,7 @@ $UPDATE_SUMMARY ### 📦 Updates ``` - $(cat update-summary.txt || echo "See commit for details") + ${{ steps.update.outputs.UPDATE_SUMMARY }} ``` ### ✅ Validation @@ -194,11 +211,19 @@ $UPDATE_SUMMARY # Get update summary UPDATE_SUMMARY=$(cat update-summary.txt || echo "Updated n8n dependencies") - git commit -m "chore: update n8n dependencies - -$UPDATE_SUMMARY - -🤖 Automated dependency update" + # Create commit message using heredoc + COMMIT_MSG=$(cat <<'COMMIT_EOF' + chore: update n8n dependencies + + ${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 else