admin管理员组文章数量:1315963
I'm using my dependencies-action at work. As is typical, we have an and a number of private repos.
The problem I'm facing is that the action can't seem to find linked issues and PRs if they're in other (also private) repos.
Fetching '{"owner":"<my company>","repo":"<private repo>","pull_number":807}'
Error: HttpError: Not Found
It can find issues in the same repo just fine.
The action is defined using the following:
name: Check PR Dependencies
on: [pull_request]
permissions:
issues: read
pull-requests: read
jobs:
check_dependencies:
runs-on: ubuntu-latest
name: Run
steps:
- uses: gregsdennis/dependencies-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
I recently added the permissions
element, thinking that would fix it, but it had no effect.
Docs:
- REST API - Get issue
- Action Permissions
The REST API docs do say that a token isn't needed for public repos, but they don't give any requirements for private repos.
I'm using my dependencies-action at work. As is typical, we have an and a number of private repos.
The problem I'm facing is that the action can't seem to find linked issues and PRs if they're in other (also private) repos.
Fetching '{"owner":"<my company>","repo":"<private repo>","pull_number":807}'
Error: HttpError: Not Found
It can find issues in the same repo just fine.
The action is defined using the following:
name: Check PR Dependencies
on: [pull_request]
permissions:
issues: read
pull-requests: read
jobs:
check_dependencies:
runs-on: ubuntu-latest
name: Run
steps:
- uses: gregsdennis/dependencies-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
I recently added the permissions
element, thinking that would fix it, but it had no effect.
Docs:
- REST API - Get issue
- Action Permissions
The REST API docs do say that a token isn't needed for public repos, but they don't give any requirements for private repos.
Share Improve this question asked Jan 29 at 21:16 gregsdennisgregsdennis 8,4285 gold badges41 silver badges76 bronze badges1 Answer
Reset to default 1GITHUB_TOKEN
only has permissions for the repository where the workflow is running (see docs):
The token's permissions are limited to the repository that contains your workflow.
If you want to access other repositories, you have to create a personal access token and store it as a secret accessible by your workflow. For your case, I'd recommend a fine-grained token with read permissions for issues and pull requests.
本文标签: github actions permissions to read an issue from a private repo within the same orgStack Overflow
版权声明:本文标题:github actions permissions to read an issue from a private repo within the same org - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741996394a2410131.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论