jupyter-server / jupyter_releaser

A set of helper scripts and GitHub Actions to aid in automated releases of Python and npm packages.
https://jupyter-releaser.readthedocs.io/en/latest/
Other
53 stars 66 forks source link

Ability to allow for non-admin user execution #555

Closed ElioDiNino closed 8 months ago

ElioDiNino commented 9 months ago

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