The CURL Way

This commit is contained in:
Julien Lengrand-Lambert
2023-02-01 10:58:49 +01:00
parent 7719c62821
commit 1532c181f2

View File

@@ -20,10 +20,12 @@ jobs:
FILE=$(cat postman/CheckoutService-v69.postman/postman.json)
echo "FILE_CONTENTS=$FILE" >> $GITHUB_ENV
- name: Push to POSTMAN
uses: fjogeleit/http-request-action@v1
with:
url: 'https://api.getpostman.com/collections'
method: 'POST'
customHeaders: '{"Content-Type": "application/json", "X-API-Key": ${{ secrets.POSTMAN_API_KEY }} }'
data: ${{ env.FILE_CONTENTS }}
run: |
echo "--> Pushing to Postman"
FILE=$(cat postman/CheckoutService-v69.postman/postman.json)
echo '{"collection": '"$FILE"' }' | curl -X POST \
--header 'Content-Type: application/json' \
--header 'X-API-Key: '"${{secrets.POSTMAN_API_KEY}}"'' \
-d @- "https://api.getpostman.com/collections"
- uses: stefanzweifel/git-auto-commit-action@v4