【发布时间】:2022-08-18 17:34:25
【问题描述】:
使用 github API,我尝试使用以下方法手动启动工作流:
curl \\
-X POST \\
-H \"Accept: application/vnd.github+json\" \\
-H \"Authorization: MY_TOKEN\" \\
https://api.github.com/repos/djpr-data/djprdashdata/actions/workflows/refresh-data.yaml/dispatches
但我不断收到身份验证错误:
{
\"message\": \"Must have admin rights to Repository.\",
\"documentation_url\": \"https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event\"
}
这似乎是与this question 类似的问题。但是我的 PAT 令牌选择了所有 admin 和 repo 范围。我还将我的用户帐户设置为存储库的admin,并且我已将工作流调度添加到工作流 yaml 文件中。
workflow_dispatch:
inputs:
tags:
description:
\"run from cmdline\"
我一直在关注https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event 的文档,并且使用 API 检索所有以前的工作流作业没有任何问题。我也尝试了runs 和jobs 端点,但得到了同样的错误。所以我现在不确定我还能做什么。还有其他地方我需要设置权限吗?
谢谢
标签: github github-actions github-api