fix: simplify Drone github-release step to avoid shell parsing issues

- Use echo with single JSON string instead of heredoc
- Use > for folded scalar to avoid newline issues
- Properly escape quotes in JSON body
- Ensure GITHUB_TOKEN is properly passed

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-23 10:31:32 +02:00
parent fe4a476e41
commit 94f10e1645
+13 -20
View File
@@ -117,29 +117,22 @@ steps:
GITHUB_TOKEN: GITHUB_TOKEN:
from_secret: GITHUB_TOKEN from_secret: GITHUB_TOKEN
commands: commands:
- | - >
# Create release payload in /tmp to avoid permission issues echo '{
cat > /tmp/release.json <<'RELEASE_EOF' "tag_name": "'${DRONE_TAG}'",
{
"tag_name": "DRONE_TAG_PLACEHOLDER",
"target_commitish": "main", "target_commitish": "main",
"name": "PicPeak DRONE_TAG_PLACEHOLDER", "name": "PicPeak '${DRONE_TAG}'",
"body": "# PicPeak DRONE_TAG_PLACEHOLDER\n\n## 🐳 Docker Images\n\nThis release includes Docker images published to GitHub Container Registry:\n\n```bash\n# Backend\ndocker pull ghcr.io/the-luap/picpeak-backend:DRONE_TAG_PLACEHOLDER\ndocker pull ghcr.io/the-luap/picpeak-backend:latest\n\n# Frontend\ndocker pull ghcr.io/the-luap/picpeak-frontend:DRONE_TAG_PLACEHOLDER\ndocker pull ghcr.io/the-luap/picpeak-frontend:latest\n```\n\n## 📦 What's New\n\nSee the [README](https://github.com/the-luap/picpeak#readme) for features and documentation.\n\n## 🚀 Quick Start\n\n```bash\n# Clone and deploy\ngit clone https://github.com/the-luap/picpeak.git\ncd picpeak\n\n# Use the tagged version\ndocker-compose -f docker-compose.prod.yml up -d\n```\n\n---\n\nFor detailed deployment instructions, see the [Deployment Guide](https://github.com/the-luap/picpeak/blob/main/DEPLOYMENT.md).", "body": "# PicPeak '${DRONE_TAG}'\n\n## 🐳 Docker Images\n\nThis release includes Docker images published to GitHub Container Registry:\n\n```bash\n# Backend\ndocker pull ghcr.io/the-luap/picpeak-backend:'${DRONE_TAG}'\ndocker pull ghcr.io/the-luap/picpeak-backend:latest\n\n# Frontend\ndocker pull ghcr.io/the-luap/picpeak-frontend:'${DRONE_TAG}'\ndocker pull ghcr.io/the-luap/picpeak-frontend:latest\n```\n\n## 📦 What'"'"'s New\n\nSee the [README](https://github.com/the-luap/picpeak#readme) for features and documentation.\n\n## 🚀 Quick Start\n\n```bash\n# Clone and deploy\ngit clone https://github.com/the-luap/picpeak.git\ncd picpeak\n\n# Use the tagged version\ndocker-compose -f docker-compose.prod.yml up -d\n```\n\n---\n\nFor detailed deployment instructions, see the [Deployment Guide](https://github.com/the-luap/picpeak/blob/main/DEPLOYMENT.md).",
"draft": false, "draft": false,
"prerelease": false "prerelease": false
} }' > /tmp/release.json
RELEASE_EOF - >
curl -X POST
# Replace placeholders with actual tag -H "Accept: application/vnd.github+json"
sed -i "s/DRONE_TAG_PLACEHOLDER/${DRONE_TAG}/g" /tmp/release.json -H "Authorization: Bearer ${GITHUB_TOKEN}"
-H "X-GitHub-Api-Version: 2022-11-28"
# Create the release on GitHub https://api.github.com/repos/the-luap/picpeak/releases
curl -X POST \ -d @/tmp/release.json
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/the-luap/picpeak/releases \
-d @/tmp/release.json
trigger: trigger:
event: event: