触发部署事件的http请求是什么样的? [英] What does the http request to trigger a deployment event look like?
问题描述
我想触发部署事件,但我不这样做我不太了解我需要发送的http请求才能使其正常工作.最低要求是什么样的? curl -vvv
很好,因为我将使用shell进行操作.
I want to fire a deployment event but I don't really understand the http request I need to send in order for it to work. What does minimal request look like? curl -vvv
is good, since I'll be doing it with shell.
推荐答案
发生部署时,将生成链接的事件.所以我认为您真正想做的是创建部署?
The event you linked is generated when a deployment occurs. So I think what you actually want to do is create a deployment?
要在带有curl的GitHub动作步骤中创建部署,它应类似于以下内容.请参阅此处的文档,以获取其他参数的详细信息通过API发送.
To create a deployment during a GitHub actions step with curl it should look something like the following. See the documentation here for details of other parameters you might want to send via the API.
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Create deployment
run: |
curl -XPOST 'https://api.github.com/repos/$GITHUB_REPOSITORY/deployments' \
-H "Content-Type: application/json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.ant-man-preview+json" \
--data '{ "ref": "master" }'
或者,GitHub Marketplace上有许多第三方操作专门用于创建部署. 请参见此处.
Alternatively, there are a number of third party actions on the GitHub Marketplace specifically for creating deployments. See here.
这篇关于触发部署事件的http请求是什么样的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!