1

我正在尝试执行一个 GitHub 操作,该操作在有人对拉取请求发表评论时运行(我正在使用 issue_comment)。

在我的index.js中,我正在运行以下几行:

const core = require("@actions/core");
const github = require("@actions/github");
.
.
.
const myToken = core.getInput("github-token");
const octokit = github.getOctokit(myToken);
core.info(JSON.stringify(octokit));

输出是

{
  "log": {},
  "rest": {
    "actions": {},
    "activity": {},
    "apps": {},
    "billing": {},
    "checks": {},
    "codeScanning": {},
    "codesOfConduct": {},
    "emojis": {},
    "enterpriseAdmin": {},
    "gists": {},
    "git": {},
    "gitignore": {},
    "interactions": {},
    "issues": {},
    "licenses": {},
    "markdown": {},
    "meta": {},
    "migrations": {},
    "orgs": {},
    "packages": {},
    "projects": {},
    "pulls": {},
    "rateLimit": {},
    "reactions": {},
    "repos": {},
    "search": {},
    "secretScanning": {},
    "teams": {},
    "users": {}
  }
}

如果没有填充拉取,我无法合并拉取请求。我该如何解决这个问题?

4

1 回答 1

0

我使用的语法来自我相信的 v4。V5 引入了 octokit.rest.pulls,所以我的问题没有显示在这个问题中,因为 octokit 不是要打印的。

于 2021-06-10T23:19:31.687 回答