github - 使用 GitHub 操作向问题添加自定义标签
问题描述
我想为使用 GitHub 操作创建的每个问题添加标签“需要更改”。
这是我尝试过的代码片段。
const octokit = new github.getOctokit(github_token);
octokit.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'changes needed',
description: 'New changes or updates proposed',
color: 'BFD4F2', // this is a green color
});
我收到这个错误。
(node:1919) UnhandledPromiseRejectionWarning: HttpError: Invalid request.
No subschema in "anyOf" matched.
For 'anyOf/0', {"labels"=>"proposed"} is not an array.
For 'anyOf/1', {"labels"=>"proposed"} is not an array.
For 'properties/labels', "proposed" is not an array.
at /home/runner/work/_actions/Karthik-Nayak98/Greeting-action/main/webpack:/greeting-action/node_modules/@octokit/request/dist-node/index.js:66:1
at processTicksAndRejections (internal/process/task_queues.js:93:5)
任何形式的帮助表示赞赏。谢谢!!
解决方案
推荐阅读
- i2c - Rs485和I2C显示器一起使用
- python - Pandas - 根据 value_counts() 结果重新编码变量
- javascript - 为什么我得到一个带有 Promisify 的 TypeError
- javascript - 如何在用javascript返回结果之前完成.map?
- angular - Angular 中的类型化管道
- c# - 如何在 Rx.Net 中使用异步累加器实现 ScanAsync 运算符?
- csv - Perl 解析 csv 文件并迭代 curl
- powershell - Get-WinEvent - 展开属性 $_.Message 以获取完整的消息详细信息?
- integer-overflow - dafny 建模整数溢出
- java - 将 Json 数组过滤为自定义数据 JAVA