如何通过 GitHub CLI 创建具有多个受让人的 Pull 请求?

Mar*_*n13 3 git bash github-cli

我正在尝试使用GitHub CLI自动化GitHub的拉取请求创建过程的拉取请求创建过程。

\n

我目前正在使用以下脚本,它的作用就像一个魅力:

\n
(\n  # Parentheses are used here to avoid the exposure of temporal variables to the outer scope.\n  # Tested on macOS bash only.\n  \n  cd ~/Projects/pet_projects/basic_temperature\n   \n  # Pushes the release branch to the remote repository.\n  git push origin release_nemo\n\n  # Logs in to GitHub CLI using pre-generated access token.\n  # https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token\n  gh auth login --with-token < ~/Projects/pet_projects/.github_cli_access_token\n   \n# Sets HEREDOC to PR_TITLE variable.\n# Indentation is avoided here intentionally.\n# https://stackoverflow.com/a/1655389/12201472\nread -r -d \'\' PR_TITLE <<-\'TEXT\'\nThis is a Placeholder PR to check whether all specs are green [Current Release][Nemo]\nTEXT\n \n# Sets HEREDOC to PR_BODY variable.\n# Indentation is avoided here intentionally.\n# https://stackoverflow.com/a/1655389/12201472\nread -r -d \'\' PR_BODY <<-\'MARKDOWN\'\n[RELEASE CARD TODO]() (**\xe2\x9d\x97This PR is NOT completed yet!\xe2\x9d\x97**)\n      \n### Already included cards:\n- None.\n \n### Cards to be included:\n- None.\n \n### Previous Release TODO\nMARKDOWN\n \n  gh pr create \\\n    --title "${PR_TITLE}" \\\n    --body "${PR_BODY}" \\\n    --base master \\\n    --head release_nemo \\\n    --assignee @me \\\n    --label Release \\\n    --web\n)\n
Run Code Online (Sandbox Code Playgroud)\n

我现在遇到的唯一问题是,我不清楚如何更新此命令

\n
gh pr create \\\n  --title "${PR_TITLE}" \\\n  --body "${PR_BODY}" \\\n  --base master \\\n  --head release_nemo \\\n  --assignee @me \\\n  --label Release \\\n  --web\n
Run Code Online (Sandbox Code Playgroud)\n

为新创建的 PR 分配多个受让人?

\n

我已仔细阅读gh pr create文档,但尚未找到实现它的方法。

\n

预先感谢您的任何帮助。

\n

cam*_*amh 8

gh 命令用于github.com/spf13/cobra命令行标志解析,该Assignees字段是StringSlice. 根据cobra 文档,您可以多次提供该标志或用逗号分隔多个值。

所以你可以做--assignee @me --assignee @you--assignee @me,@you