shell quoting and variable interpolation issues in the curl command
This commit is contained in:
parent
d1322c2a48
commit
7eb3eb8b32
1 changed files with 18 additions and 7 deletions
|
|
@ -50,16 +50,27 @@ jobs:
|
||||||
if: steps.changes.outputs.changed == 'true'
|
if: steps.changes.outputs.changed == 'true'
|
||||||
env:
|
env:
|
||||||
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
||||||
|
BRANCH_NAME: ${{ steps.commit.outputs.branch_name }}
|
||||||
|
API_URL: ${{ forgejo.api_url }}
|
||||||
|
REPO: ${{ forgejo.repository }}
|
||||||
run: |
|
run: |
|
||||||
DATE=$(date +%Y-%m-%d)
|
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 \
|
curl -X POST \
|
||||||
-H "Authorization: token $FORGEJO_TOKEN" \
|
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{
|
-d @/tmp/pr-payload.json \
|
||||||
"title": "chore: weekly flake update '"$DATE"'",
|
"${API_URL}/repos/${REPO}/pulls"
|
||||||
"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"
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue