我有一个操作,其中包含以下yaml:
on:
workflow_dispatch:
inputs:
BuildTarget:
description: "Targets to rebuild. Set to all to rebuild everything."
required: false
default: ""
我可以使用以下方法触发它:
gh api /repos/:owner/:repo/actions/workflows/build_dev.yml/dispatches -F ref=":branch"
但是我似乎无法弄清楚如何从命令行界面将输入传递到操作中。
我尝试过:
gh api /repos/:owner/:repo/actions/workflows/build_dev.yml/dispatches -F ref=":branch" -F BuildTarget=all
这提示信息告诉我们:"BuildTarget"不是一个允许的关键字。(HTTP 422)
尝试以下操作:
gh api /repos/:owner/:repo/actions/workflows/build_dev.yml/dispatches -F ref=":branch" -F inputs='{ "BuildTarget": "all" }'
给我一个错误提示:对于“properties/inputs”,“{ \”BuildTarget\“:\”all\“}”不是对象。(HTTP 422)
您有没有想过如何从cli调用此api并将输入属性传递到工作流程中?
https://docs.github.com/cn/rest/actions/workflows https://docs.github.com/cn/rest/repos/repos#create-a-repository-dispatch-event
- 张馆长