shell quoting and variable interpolation issues in the curl command

This commit is contained in:
pazpi 2026-01-08 09:48:34 +01:00
parent d1322c2a48
commit 7eb3eb8b32

View file

@ -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"