gpt4 book ai didi

github - 如何在推送时在 github 页面中执行多行 curl 命令?

转载 作者:行者123 更新时间:2023-12-05 02:32:36 25 4
gpt4 key购买 nike

这是我到目前为止的工作流程,github 告诉我第 8 行有错误,但我找不到。

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"
}'

最佳答案

替换:

- run: >

与:

- run: |

然后将脚本缩进 2 个空格:

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"
}'

关于github - 如何在推送时在 github 页面中执行多行 curl 命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71205642/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com