From 18cd7bc55e4961db9bc9bf8f7b63aad37ae24312 Mon Sep 17 00:00:00 2001 From: aitbc1 Date: Fri, 27 Mar 2026 23:34:58 +0100 Subject: [PATCH] fix: replace heredoc with echo commands to resolve YAML syntax error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit YAML SYNTAX FIX: Resolve could not find expected ':' error Issues Fixed: ❌ yaml: line 206: could not find expected ':' ❌ Heredoc content interpreted as YAML ❌ Workflow config file invalid ❌ YAML validation failure Root Cause: - Heredoc content being parsed as YAML - Multi-line content not properly escaped - YAML parser expecting key-value pairs - Heredoc syntax incompatible with YAML structure Solution Applied: ✅ Replaced heredoc with echo commands ✅ Line-by-line file creation ✅ Proper YAML syntax throughout ✅ Valid shell script commands Implementation Changes: - Removed heredoc syntax completely - Used echo commands for each line - Proper shell escaping for quotes - Line-by-line file construction Generated Content: - [tool.poetry] section - Package name, version, description - Authors information - Build system configuration - Poetry core requirements Impact: - YAML file now validates correctly - Workflow config file is valid - Package generation works properly - CI/CD execution without syntax errors - Proper pyproject.toml creation This resolves the YAML syntax error that was preventing the package tests workflow from being parsed correctly. --- .gitea/workflows/package-tests.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/package-tests.yml b/.gitea/workflows/package-tests.yml index 8f1c7f52..db1c41a5 100644 --- a/.gitea/workflows/package-tests.yml +++ b/.gitea/workflows/package-tests.yml @@ -202,17 +202,15 @@ jobs: # Create minimal package directories for testing for pkg in aitbc-core aitbc-crypto aitbc-sdk aitbc-agent-sdk; do mkdir -p "repo/packages/py/$pkg" - cat > "repo/packages/py/$pkg/pyproject.toml" << 'EOF' -[tool.poetry] -name = "$pkg" -version = "0.1.0" -description = "Test package for CI" -authors = ["AITBC Team"] - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" -EOF + echo '[tool.poetry]' > "repo/packages/py/$pkg/pyproject.toml" + echo "name = \"$pkg\"" >> "repo/packages/py/$pkg/pyproject.toml" + echo 'version = "0.1.0"' >> "repo/packages/py/$pkg/pyproject.toml" + echo 'description = "Test package for CI"' >> "repo/packages/py/$pkg/pyproject.toml" + echo 'authors = ["AITBC Team"]' >> "repo/packages/py/$pkg/pyproject.toml" + echo '' >> "repo/packages/py/$pkg/pyproject.toml" + echo '[build-system]' >> "repo/packages/py/$pkg/pyproject.toml" + echo 'requires = ["poetry-core"]' >> "repo/packages/py/$pkg/pyproject.toml" + echo 'build-backend = "poetry.core.masonry.api"' >> "repo/packages/py/$pkg/pyproject.toml" done cd repo