我有以下curl 请求,我想在我的CircleCI 管道的config.yml 文件中使用它。
但它一直给我错误,我找不到正确的语法来让它工作。我将文件放入 YAML lint 中,错误是在此上下文中不允许映射值。这是我的卷曲请求
curl -X POST -H 'Content-type: application/json' --data '{"text":"This is a test!"}' [WEBHOOK URL]
Run Code Online (Sandbox Code Playgroud)
这是我的 config.yml 文件:
version: 2.1
jobs:
build:
working_directory: ~/circleci-python
docker:
- image: "circleci/python:3.6.4"
steps:
- checkout
- run: python3 main.py
test:
working_directory: ~/circleci-python
docker:
- image: "circleci/python:3.6.4"
steps:
- checkout
- run: python3 main-test.py
- run: curl -X POST -H 'Content-type: application/json' --data '{"text":"This is a test!"}' [WEBHOOK URL]
workflows:
build_and_test:
jobs:
- build
- test:
requires:
- build
Run Code Online (Sandbox Code Playgroud)