From 94f10e164502e6848cd720ee5a5c2822abbde46f Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 23 Jul 2025 10:31:32 +0200 Subject: [PATCH] fix: simplify Drone github-release step to avoid shell parsing issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .drone.yml | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4433235..5809ed2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -117,29 +117,22 @@ steps: GITHUB_TOKEN: from_secret: GITHUB_TOKEN commands: - - | - # Create release payload in /tmp to avoid permission issues - cat > /tmp/release.json <<'RELEASE_EOF' - { - "tag_name": "DRONE_TAG_PLACEHOLDER", + - > + echo '{ + "tag_name": "'${DRONE_TAG}'", "target_commitish": "main", - "name": "PicPeak DRONE_TAG_PLACEHOLDER", - "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).", + "name": "PicPeak '${DRONE_TAG}'", + "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, "prerelease": false - } - RELEASE_EOF - - # Replace placeholders with actual tag - sed -i "s/DRONE_TAG_PLACEHOLDER/${DRONE_TAG}/g" /tmp/release.json - - # Create the release on GitHub - curl -X POST \ - -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 + }' > /tmp/release.json + - > + curl -X POST + -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: event: