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

Ability to allow for non-admin user execution #555

Closed
ElioDiNino opened this issue Feb 23, 2024 · 6 comments
Closed

Ability to allow for non-admin user execution #555

ElioDiNino opened this issue Feb 23, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@ElioDiNino
Copy link
Contributor

Problem

I have modified the default jupyter_releaser workflow such that a GitHub app token is used instead of a user token. However, within the prepare_environment function, a check is made through the GitHub API to see if the user is a repo admin (exact lines here). This is an issue since even though the token is setup such that all the necessary permissions are granted, this arbitrary check blocks non-admin repo members from making releases.

I tried getting around this by modifying the actions with GITHUB_ACTOR and setting the value to our bot username, but the GitHub app isn't treated as a user by the API (understandably) and so it fails.

image

Proposed Solution

I think the check should either change to validate the required permissions of the token, or for an easier workaround, be able to be turned off through a flag/environment variable (e.g. RH_ADMIN_CHECK=false).

Additional context

@ElioDiNino ElioDiNino added the enhancement New feature or request label Feb 23, 2024
Copy link

welcome bot commented Feb 23, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@ElioDiNino ElioDiNino changed the title Ability to allow for non-admin user Ability to allow for non-admin user execution Feb 23, 2024
@ElioDiNino
Copy link
Contributor Author

@blink1073 Would you be able to give some thoughts on this? I can implement the latter proposed solution pretty easily and quickly if you approve of it.

@blink1073
Copy link
Contributor

Hi @ElioDiNino, I think an RH_ADMIN_CHECK with a default of true makes sense.

@ElioDiNino
Copy link
Contributor Author

Hi @ElioDiNino, I think an RH_ADMIN_CHECK with a default of true makes sense.

Okay, thanks! I will create a PR for that soon

@ElioDiNino
Copy link
Contributor Author

Relevant changes in #559

@ElioDiNino
Copy link
Contributor Author

Resolved with the latest release 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants