如何通过 GitHub CLI 与多个受让人创建合并请求?
How to create a Pull Request via GitHub CLI with multiple assignees?
我正在尝试为 GitHub using the GitHub CLI.
自动执行拉取请求创建过程
我目前正在使用以下脚本,它非常有效:
(
# 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.
#
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.
#
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
field is a StringSlice
. According to the cobra docs,您可以多次提供标志或用逗号分隔多个值。
所以你可以--assignee @me --assignee @you
或--assignee @me,@you
。
我正在尝试为 GitHub using the GitHub CLI.
自动执行拉取请求创建过程我目前正在使用以下脚本,它非常有效:
(
# 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.
#
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.
#
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
field is a StringSlice
. According to the cobra docs,您可以多次提供标志或用逗号分隔多个值。
所以你可以--assignee @me --assignee @you
或--assignee @me,@you
。