Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Forked 的仓库提交的 PR 无法正常使用 GITHUB_TOKEN(无 write 权限) #1

Open
JohnNiang opened this issue Apr 28, 2022 · 0 comments
Assignees

Comments

@JohnNiang
Copy link

JumpServer 版本(v1.5.9以下不再支持)

None.

浏览器版本

None.

Bug 描述

PR:metersphere/metersphere#13191 是从 forked 仓库提交的,但是始终无法正常使用 action-generic-handler action。具体错误日志如下:

bash: cannot set terminal process group (-1): Not a tty
bash: no job control in this shell
+ case ${GITHUB_EVENT_NAME} in
+ echo 'Event is pull_request, run pull request handler'
+ bash -ixeu /on_pull_request.sh
bash: cannot set terminal process group (-1): Not a tty
bash: no job control in this shell
+ [[ pull_request != \p\u\l\l\_\r\e\q\u\e\s\t ]]
+ on_pull_request_close_del_branch_if_need
++ jq -r .action
Event is pull_request, run pull request handler
+ PR_ACTION=opened
+ [[ opened != \c\l\o\s\e\d ]]
+ echo 'Action is not closed, pass'
+ return 0
Action is not closed, pass
+ on_pull_request_open_edit_auto_label_it
++ jq -r .action
+ PR_ACTION=opened
+ [[ opened != \e\d\i\t\e\d ]]
+ [[ opened != \o\p\e\n\e\d ]]
++ jq -r .pull_request.title
+ PR_TITLE='docs: update readme'
++ jq -r .pull_request.issue_url
+ PR_ISSUE_URL=https://api.github.com/repos/metersphere/metersphere/issues/13191
+ label=
+ [[ docs: update readme =~ fix ]]
+ [[ docs: update readme =~ feat ]]
+ [[ docs: update readme =~ perf ]]
+ [[ docs: update readme =~ refactor ]]
+ [[ docs: update readme =~ ci ]]
+ [[ -z '' ]]
+ return 0
+ on_pull_request_open_add_reviewer
++ jq -r .action
+ PR_ACTION=opened
+ [[ opened != \o\p\e\n\e\d ]]
++ jq -r .pull_request.url
+ PR_URL=https://api.github.com/repos/metersphere/metersphere/pulls/13191
+ PR_REVIEWER_URL=https://api.github.com/repos/metersphere/metersphere/pulls/13191/requested_reviewers
+ data='{"team_reviewers":["developers"]}'
+ curl --fail -X POST --data '{"team_reviewers":["developers"]}' -H 'Content-Type: application/json' -H 'Authorization: ***' https://api.github.com/repos/metersphere/metersphere/pulls/13191/requested_reviewers
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100    33    0     0  100    33      0    1
curl: (22) The requested URL returned error: 403

请参考:

Bug 重现步骤(有截图更好)

  1. Fork 仓库:https://github.com/metersphere/metersphere
  2. 随便修改任意文件并 commit
  3. 创建 Pull Request
  4. 可看到 MeterSphere 通用 PR 处理 / 为 PR 添加标签 (pull_request) 任务运行失败
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants