mapri50
mapri50

Reputation: 41

How to execute a multi-line curl command in github pages on push?

This is my workflow so far, github tells me that there's and error on line 8, but I can't find it.

name: restartServer
on: [push]
jobs:
  check-bats-version:
    runs-on: ubuntu-latest
    steps:
      - run: >
        curl --location --request POST 'https://panel.discordbothosting.com/api/client/servers/fd21d417/power' \
          --header 'Accept: application/json' \
          --header 'Content-Type: application/json' \
          --header 'Authorization: Bearer APIKEY' \
          --data-raw '{
            "signal": "restart"
          }'

Upvotes: 4

Views: 3641

Answers (1)

jessehouwing
jessehouwing

Reputation: 114796

Replace:

- run: >

With:

- run: |

And indent your script 2 more spaces:

name: restartServer
on: [push]
jobs:
 check-bats-version:
   runs-on: ubuntu-latest
   steps:
     - run: |
         curl --location --request POST 'https://panel.discordbothosting.com/api/client/servers/fd21d417/power' \
           --header 'Accept: application/json' \
           --header 'Content-Type: application/json' \
           --header 'Authorization: Bearer APIKEY' \
           --data-raw '{
             "signal": "restart"
           }'

Upvotes: 6

Related Questions