semantic-release / semantic-release/github
Feature request: precheck more permissions needed by other steps in verify step
A pull request for this has already been merged.
- #897 by @jedwards1211 — merged
- Dominant language
- JavaScript
- Stars
- 534
- Forks
- 150
- Avg merge
- 1m
- Merged PRs (30d)
- 3
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 pushwith 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the verify step and the later publish and success steps described in the issue. Reproduce the listed permission checks and investigate GitHub API behavior for push, issue, and release updates; done means verify detects required permissions before later steps can partially succeed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github, javascript
- Domain
- api, authorization, release
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100