fix: escape pipe characters in woodpecker yaml

Use # delimiter instead of | for sed commands to avoid YAML parsing issues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Erdenebat Tsenddorj
2026-01-21 21:19:06 +08:00
parent 0f200fe692
commit 4f2168e089

View File

@@ -55,12 +55,12 @@ steps:
image: alpine:latest image: alpine:latest
commands: commands:
- apk add --no-cache sed git - apk add --no-cache sed git
- sed -i "s|image:.*hell-world-backend.*|image: registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8}|g" manifests/backend-deployment.yaml - 'sed -i "s#image:.*hell-world-backend.*#image: registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8}#g" manifests/backend-deployment.yaml'
- sed -i "s|image:.*hell-world-frontend.*|image: registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8}|g" manifests/frontend-deployment.yaml - 'sed -i "s#image:.*hell-world-frontend.*#image: registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8}#g" manifests/frontend-deployment.yaml'
- git config user.email "ci@gecore.mn" - git config user.email "ci@gecore.mn"
- git config user.name "Woodpecker CI" - git config user.name "Woodpecker CI"
- git add manifests/ - git add manifests/
- git commit -m "ci: update images to ${CI_COMMIT_SHA:0:8}" || true - 'git commit -m "ci: update images to ${CI_COMMIT_SHA:0:8}" || true'
- git push origin main || true - git push origin main || true
when: when:
event: push event: push