Description
Related to #738, it would be good to try to verify that we have as many of the necessary GitHub permissions as possible before running other steps. For example, publish can succeed but then adding issue comments can fail during the success
step; then adding those comments manually is the only option. But if we could detect the lack of permissions and error out on the verify
step, then the user can fix their token and rerun, and the issue comments will be created successfully after publish.
As I mentioned in #738:
What I've found out so far is:
- We can check push permission by running
git push
with no changes - We can get the scopes of a classic PAT but this doesn't work for fine-grained PATs right now
- GitHub devs seem open to making the permissions on a GitHub action token visible via the api, but haven't done so yet
Maybe we can check permission to update issues and releases by doing a no-op update on one (sending the title it already has in an update, etc), I will have to experiment. But we'd be able to avoid hacky workarounds if the GitHub API provided an explicit way to check if we have permissions to do a certain operation.