Fix critical heredoc issues with echo commands
Some checks failed
Build apt-ostree Package / Build apt-ostree Package (push) Failing after 1m20s
Simple CI / Build and Test (push) Failing after 2s
Simple CI / Security Audit (push) Failing after 2s
Simple CI / Build Package (push) Failing after 2s
Test apt-ostree Build / Test apt-ostree Build (with existing libostree) (push) Failing after 1m23s
Simple CI / Final Status (push) Successful in 1s

- Replace all heredocs with echo commands to avoid YAML indentation problems
- Eliminate 'unexpected end of file' shell syntax errors
- Maintain proper YAML structure while ensuring shell compatibility
- Fix all workflow files: build.yml, test.yml, update-readme.yml, ci.yml
- All files now pass yq validation
This commit is contained in:
joe 2025-08-13 18:18:29 -07:00
parent eadb7e46c8
commit bb502b695d
4 changed files with 93 additions and 124 deletions

View file

@ -59,23 +59,19 @@ jobs:
echo "✅ apt-cacher-ng is available, configuring proxy sources..."
# Configure apt-cacher-ng proxy sources
cat > /etc/apt/sources.list.d/apt-cacher-ng.list <<- 'EOF'
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main
EOF
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main" >> /etc/apt/sources.list.d/apt-cacher-ng.list
# Update package lists with proxy sources
apt update -y
else
echo "⚠️ apt-cacher-ng not available, using standard Debian sources..."
# Use standard Debian sources
cat > /etc/apt/sources.list.d/standard.list <<- 'EOF'
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
EOF
echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list
echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list
# Update package lists
apt update -y
fi
@ -378,20 +374,17 @@ jobs:
echo "Architecture: $PKG_ARCH"
# Create package metadata
cat > package.json << 'EOF'
{
"name": "$PKG_NAME",
"version": "$PKG_VERSION",
"architecture": "$PKG_ARCH",
"description": "APT-OSTree package for Debian-based OSTree systems",
"homepage": "https://git.raines.xyz/robojerk/apt-ostree",
"repository": "https://git.raines.xyz/robojerk/apt-ostree.git",
"license": "MIT",
"keywords": ["ostree", "apt", "debian", "ubuntu", "immutable", "atomic"],
"author": "Robojerk <robojerk@example.com>",
"maintainer": "Robojerk <robojerk@example.com>"
}
EOF
echo '{' > package.json
echo ' "name": "'"$PKG_NAME"'",' >> package.json
echo ' "version": "'"$PKG_VERSION"'",' >> package.json
echo ' "architecture": "'"$PKG_ARCH"'",' >> package.json
echo ' "description": "APT-OSTree package for Debian-based OSTree systems",' >> package.json
echo ' "homepage": "https://git.raines.xyz/robojerk/apt-ostree",' >> package.json
echo ' "repository": "https://git.raines.xyz/robojerk/apt-ostree.git",' >> package.json
echo ' "license": "MIT",' >> package.json
echo ' "keywords": ["ostree", "apt", "debian", "ubuntu", "immutable", "atomic"],' >> package.json
echo ' "author": "Robojerk <robojerk@example.com>",' >> package.json
echo ' "maintainer": "Robojerk <robojerk@example.com>"}' >> package.json
# Upload package to Forgejo Package Registry
# Note: This is a placeholder - actual implementation depends on Forgejo API
@ -407,28 +400,26 @@ jobs:
echo "Creating build summary..."
# Create a summary markdown file
cat > BUILD_SUMMARY.md << 'EOF'
# APT-OSTree Build Summary
## Build Information
- **Build Date**: $(date '+%Y-%m-%d %H:%M:%S UTC')
- **Build ID**: $(date +%s)
- **Commit**: $(git rev-parse --short HEAD 2>/dev/null || echo "Unknown")
- **Branch**: $(git branch --show-current 2>/dev/null || echo "Unknown")
## Build Status
- **Status**: ✅ SUCCESS
- **Container**: debian:latest
- **Rust Version**: $(rustc --version)
- **Cargo Version**: $(cargo --version)
## Built Packages
EOF
echo '# APT-OSTree Build Summary' > BUILD_SUMMARY.md
echo '' >> BUILD_SUMMARY.md
echo '## Build Information' >> BUILD_SUMMARY.md
echo '- **Build Date**: '"$(date '+%Y-%m-%d %H:%M:%S UTC')" >> BUILD_SUMMARY.md
echo '- **Build ID**: '"$(date +%s)" >> BUILD_SUMMARY.md
echo '- **Commit**: '"$(git rev-parse --short HEAD 2>/dev/null || echo "Unknown")" >> BUILD_SUMMARY.md
echo '- **Branch**: '"$(git branch --show-current 2>/dev/null || echo "Unknown")" >> BUILD_SUMMARY.md
echo '' >> BUILD_SUMMARY.md
echo '## Build Status' >> BUILD_SUMMARY.md
echo '- **Status**: ✅ SUCCESS' >> BUILD_SUMMARY.md
echo '- **Container**: debian:latest' >> BUILD_SUMMARY.md
echo '- **Rust Version**: '"$(rustc --version)" >> BUILD_SUMMARY.md
echo '- **Cargo Version**: '"$(cargo --version)" >> BUILD_SUMMARY.md
echo '' >> BUILD_SUMMARY.md
echo '## Built Packages' >> BUILD_SUMMARY.md
echo '' >> BUILD_SUMMARY.md
# Add package information
if ls ../*.deb >/dev/null 2>&1; then
echo "" >> BUILD_SUMMARY.md
echo "### Debian Packages" >> BUILD_SUMMARY.md
echo '### Debian Packages' >> BUILD_SUMMARY.md
for pkg in ../*.deb; do
PKG_NAME=$(dpkg-deb -f "$pkg" Package 2>/dev/null || echo "Unknown")
PKG_VERSION=$(dpkg-deb -f "$pkg" Version 2>/dev/null || echo "Unknown")
@ -439,13 +430,13 @@ jobs:
fi
# Add dependency information
echo "" >> BUILD_SUMMARY.md
echo "### Dependencies" >> BUILD_SUMMARY.md
echo "- libapt-pkg-dev ✅" >> BUILD_SUMMARY.md
echo "- libssl-dev ✅" >> BUILD_SUMMARY.md
echo "- libdbus-1-dev ✅" >> BUILD_SUMMARY.md
echo "- libglib2.0-dev ✅" >> BUILD_SUMMARY.md
echo "- All build dependencies satisfied ✅" >> BUILD_SUMMARY.md
echo '' >> BUILD_SUMMARY.md
echo '### Dependencies' >> BUILD_SUMMARY.md
echo '- libapt-pkg-dev ✅' >> BUILD_SUMMARY.md
echo '- libssl-dev ✅' >> BUILD_SUMMARY.md
echo '- libdbus-1-dev ✅' >> BUILD_SUMMARY.md
echo '- libglib2.0-dev ✅' >> BUILD_SUMMARY.md
echo '- All build dependencies satisfied ✅' >> BUILD_SUMMARY.md
echo "Build summary created: BUILD_SUMMARY.md"
echo "Build completed successfully! 🎉"

View file

@ -36,18 +36,14 @@ jobs:
echo "Checking for apt-cacher-ng availability..."
if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
echo "✅ apt-cacher-ng is available, configuring proxy sources..."
cat > /etc/apt/sources.list.d/apt-cacher-ng.list <<- 'EOF'
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main
EOF
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main" >> /etc/apt/sources.list.d/apt-cacher-ng.list
apt update -y
else
echo "⚠️ apt-cacher-ng not available, using standard Debian sources..."
cat > /etc/apt/sources.list.d/standard.list <<- 'EOF'
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
EOF
echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list
echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list
apt update -y
fi
@ -104,16 +100,12 @@ jobs:
run: |
apt update -y
if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
cat > /etc/apt/sources.list.d/apt-cacher-ng.list <<- 'EOF'
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
EOF
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list
apt update -y
else
cat > /etc/apt/sources.list.d/standard.list <<- 'EOF'
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
EOF
echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list
echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list
apt update -y
fi
@ -152,16 +144,12 @@ jobs:
run: |
apt update -y
if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
cat > /etc/apt/sources.list.d/apt-cacher-ng.list <<- 'EOF'
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
EOF
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list
apt update -y
else
cat > /etc/apt/sources.list.d/standard.list <<- 'EOF'
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
EOF
echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list
echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list
apt update -y
fi
@ -212,23 +200,21 @@ jobs:
echo "Security: Completed"
echo "Package: Completed"
cat > CI_SUMMARY.md <<- 'EOF'
# APT-OSTree CI Summary
## Build Information
- **Build Date**: $(date '+%Y-%m-%d %H:%M:%S UTC')
- **Build ID**: $(date +%s)
- **Commit**: $(git rev-parse --short HEAD 2>/dev/null || echo "Unknown")
- **Branch**: $(git branch --show-current 2>/dev/null || echo "Unknown")
## Job Results
- **Build and Test**: Completed
- **Security**: Completed
- **Package**: Completed
## Summary
CI completed. Check individual job results above.
EOF
echo "# APT-OSTree CI Summary" > CI_SUMMARY.md
echo "" >> CI_SUMMARY.md
echo "## Build Information" >> CI_SUMMARY.md
echo "- **Build Date**: $(date '+%Y-%m-%d %H:%M:%S UTC')" >> CI_SUMMARY.md
echo "- **Build ID**: $(date +%s)" >> CI_SUMMARY.md
echo "- **Commit**: $(git rev-parse --short HEAD 2>/dev/null || echo "Unknown")" >> CI_SUMMARY.md
echo "- **Branch**: $(git branch --show-current 2>/dev/null || echo "Unknown")" >> CI_SUMMARY.md
echo "" >> CI_SUMMARY.md
echo "## Job Results" >> CI_SUMMARY.md
echo "- **Build and Test**: Completed" >> CI_SUMMARY.md
echo "- **Security**: Completed" >> CI_SUMMARY.md
echo "- **Package**: Completed" >> CI_SUMMARY.md
echo "" >> CI_SUMMARY.md
echo "## Summary" >> CI_SUMMARY.md
echo "CI completed. Check individual job results above." >> CI_SUMMARY.md
echo "CI summary created: CI_SUMMARY.md"
echo "✅ All CI jobs completed! 🎉"

View file

@ -43,23 +43,19 @@ jobs:
echo "✅ apt-cacher-ng is available, configuring proxy sources..."
# Configure apt-cacher-ng proxy sources
cat > /etc/apt/sources.list.d/apt-cacher-ng.list <<- 'EOF'
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main
EOF
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main" >> /etc/apt/sources.list.d/apt-cacher-ng.list
# Update package lists with proxy sources
apt update -y
else
echo "⚠️ apt-cacher-ng not available, using standard Debian sources..."
# Use standard Debian sources
cat > /etc/apt/sources.list.d/standard.list <<- 'EOF'
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
EOF
echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list
echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list
# Update package lists
apt update -y
fi
@ -199,7 +195,7 @@ jobs:
echo "Creating test summary..."
# Create a summary markdown file
cat > TEST_SUMMARY.md << 'EOF'
echo "
# APT-OSTree Test Summary
## Test Information
@ -230,7 +226,7 @@ jobs:
- This is a test workflow to verify the build process
- Full package building is handled by the build workflow
- All tests passed successfully
EOF
" > TEST_SUMMARY.md
echo "Test summary created: TEST_SUMMARY.md"
echo "Test completed successfully! 🎉"

View file

@ -28,23 +28,19 @@ jobs:
echo "✅ apt-cacher-ng is available, configuring proxy sources..."
# Configure apt-cacher-ng proxy sources
cat > /etc/apt/sources.list.d/apt-cacher-ng.list <<- 'EOF'
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main
EOF
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main" >> /etc/apt/sources.list.d/apt-cacher-ng.list
# Update package lists with proxy sources
apt update -y
else
echo "⚠️ apt-cacher-ng not available, using standard Debian sources..."
# Use standard Debian sources
cat > /etc/apt/sources.list.d/standard.list <<- 'EOF'
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
EOF
echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list
echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list
# Update package lists
apt update -y
fi
@ -65,7 +61,7 @@ jobs:
echo "Updating README with workflow run ID: $WORKFLOW_RUN_ID"
# Create the download section content
cat > download-section.md << EOF
echo "
## 📦 Download Latest Build
@ -115,7 +111,7 @@ jobs:
---
EOF
" > download-section.md
# Replace the existing download section in README.md
# First, remove the old download section
@ -145,7 +141,7 @@ jobs:
echo "Creating update summary..."
# Create a summary markdown file
cat > UPDATE_SUMMARY.md << 'EOF'
echo "
# README Update Summary
## Update Information
@ -163,7 +159,7 @@ jobs:
- README has been automatically updated
- Changes have been committed and pushed to main branch
- Users can now access the latest build information
EOF
" > UPDATE_SUMMARY.md
echo "Update summary created: UPDATE_SUMMARY.md"
echo "README update completed successfully! 🎉"