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

Improve error handling for missing issues: write/pull-requests: write #21

Open
jsoref opened this issue Jan 3, 2025 · 0 comments
Open

Comments

@jsoref
Copy link

jsoref commented Jan 3, 2025

Consider a run of a workflow using this action from a fork with restricted permissions: https://github.com/check-spelling-sandbox/opentelemetry-python-contrib/actions/runs/12592914477/job/35098193103#step:2:8

const addAssigneesResult = await client.rest.issues.addAssignees({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
issue_number: github.context.issue.number,
assignees: Array.from(owner_users),
});
core.debug(util.inspect(addAssigneesResult));

Run dyladan/component-owners@main
4 owners found ofek1weiss oxeye-nikolay nikosokolik shalevr
Adding assignees
Error: Resource not accessible by integration - https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue

The readme suggests the correct permissions:

permissions:
contents: read # to read changed files
issues: write # to read/write issue assignees
pull-requests: write # to read/write PR reviewers

But when a workflow doesn't correctly request them, the action should provide a better error message.

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

1 participant