Skip to content

Commit

Permalink
fix: avoid Argument list too long error (#212)
Browse files Browse the repository at this point in the history
Pass POST data to curl via a file to avoid getting an
`Argument list too long` error.

Fixes: #211
  • Loading branch information
richardlau authored Feb 27, 2022
1 parent 279e0b4 commit 506849d
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ name: Update CI reliability
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
create-report:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16
- run: npm i -g node-core-utils
- run: ncu-config --global set jenkins_token ${{ secrets.JENKINS_TOKEN }}
- run: ncu-config --global set token ${{ secrets.USER_TOKEN }}
- run: ncu-config --global set username ${{ secrets.USER_NAME }}
- run: ncu-ci walk pr --stats=true --markdown $PWD/results.md
- run: |
body=`cat results.md | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))'`
- run: |
title_date=$(date +%Y-%m-%d)
echo "{ \"title\": \"CI Reliability ${title_date}\", \"body\": " >> body.json
cat results.md | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))' >> body.json
echo "}" >> body.json
curl --request POST \
--url https://api.github.com/repos/${GITHUB_REPOSITORY}/issues \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data "{
\"title\": \"CI Reliability ${title_date}\",
\"body\": ${body}
}"
--data @body.json

0 comments on commit 506849d

Please sign in to comment.