From 7eb3eb8b32514a5e194623948d978ee7500bb765 Mon Sep 17 00:00:00 2001 From: pazpi Date: Thu, 8 Jan 2026 09:48:34 +0100 Subject: [PATCH] shell quoting and variable interpolation issues in the curl command --- .forgejo/workflows/auto-update-pr.yaml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/auto-update-pr.yaml b/.forgejo/workflows/auto-update-pr.yaml index 0add79b..03f2858 100644 --- a/.forgejo/workflows/auto-update-pr.yaml +++ b/.forgejo/workflows/auto-update-pr.yaml @@ -50,16 +50,27 @@ jobs: if: steps.changes.outputs.changed == 'true' env: FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} + BRANCH_NAME: ${{ steps.commit.outputs.branch_name }} + API_URL: ${{ forgejo.api_url }} + REPO: ${{ forgejo.repository }} run: | DATE=$(date +%Y-%m-%d) + TIMESTAMP=$(date -Iseconds) + + cat > /tmp/pr-payload.json << EOF + { + "title": "chore: weekly flake update ${DATE}", + "body": "Automated flake update from CI.\n\nThis PR updates all flake inputs.\n\n**Note:** Build verification will run automatically on this PR.\n\nGenerated on: ${TIMESTAMP}", + "head": "${BRANCH_NAME}", + "base": "master" + } + EOF + + echo "Creating PR with payload:" + cat /tmp/pr-payload.json curl -X POST \ -H "Authorization: token $FORGEJO_TOKEN" \ -H "Content-Type: application/json" \ - -d '{ - "title": "chore: weekly flake update '"$DATE"'", - "body": "Automated flake update from CI.\n\nThis PR updates all flake inputs.\n\n**Note:** Build verification will run automatically on this PR.\n\nGenerated on: '"$(date -Iseconds)"'", - "head": "'"${{ steps.commit.outputs.branch_name }}"'", - "base": "master" - }' \ - "${{ forgejo.api_url }}/repos/${{ forgejo.repository }}/pulls" + -d @/tmp/pr-payload.json \ + "${API_URL}/repos/${REPO}/pulls"