繁体   English   中英

如何通过 GitHub CLI 与多个受让人一起创建拉取请求?

[英]How to create a Pull Request via GitHub CLI with multiple assignees?

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

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

(
  # Parentheses are used here to avoid the exposure of temporal variables to the outer scope.
  # Tested on macOS bash only.
  
  cd ~/Projects/pet_projects/basic_temperature
   
  # Pushes the release branch to the remote repository.
  git push origin release_nemo

  # Logs in to GitHub CLI using pre-generated access token.
  # https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
  gh auth login --with-token < ~/Projects/pet_projects/.github_cli_access_token
   
# Sets HEREDOC to PR_TITLE variable.
# Indentation is avoided here intentionally.
# https://stackoverflow.com/a/1655389/12201472
read -r -d '' PR_TITLE <<-'TEXT'
This is a Placeholder PR to check whether all specs are green [Current Release][Nemo]
TEXT
 
# Sets HEREDOC to PR_BODY variable.
# Indentation is avoided here intentionally.
# https://stackoverflow.com/a/1655389/12201472
read -r -d '' PR_BODY <<-'MARKDOWN'
[RELEASE CARD TODO]() (**❗This PR is NOT completed yet!❗**)
      
### Already included cards:
- None.
 
### Cards to be included:
- None.
 
### Previous Release TODO
MARKDOWN
 
  gh pr create \
    --title "${PR_TITLE}" \
    --body "${PR_BODY}" \
    --base master \
    --head release_nemo \
    --assignee @me \
    --label Release \
    --web
)

我现在唯一的问题,我不清楚如何更新这个命令

gh pr create \
  --title "${PR_TITLE}" \
  --body "${PR_BODY}" \
  --base master \
  --head release_nemo \
  --assignee @me \
  --label Release \
  --web

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

我已经仔细阅读了gh pr create文档,但我还没有找到实现它的方法。

提前感谢您的帮助。

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM