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:
+13
-20
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user