refactor: improve Docker image pull string construction in Gitea CI workflow using jq arguments
This commit is contained in:
@@ -103,9 +103,8 @@ jobs:
|
|||||||
|
|
||||||
# Check if Docker Image section already exists
|
# Check if Docker Image section already exists
|
||||||
if [[ "$OLD_BODY" != *"## 🐳 Docker Image"* ]]; then
|
if [[ "$OLD_BODY" != *"## 🐳 Docker Image"* ]]; then
|
||||||
NEW_BODY="${OLD_BODY}\n\n## 🐳 Docker Image\n\`\`\`bash\ndocker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG_NAME}\n\`\`\`"
|
jq -n --arg old "$OLD_BODY" --arg img "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG_NAME}" \
|
||||||
|
'{body: ($old + "\n\n## 🐳 Docker Image\n```bash\ndocker pull " + $img + "\n```")}' | \
|
||||||
jq -n --arg body "$NEW_BODY" '{body: $body}' | \
|
|
||||||
curl -s -X PATCH \
|
curl -s -X PATCH \
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
|
|||||||
Reference in New Issue
Block a user