Open dbushong opened 7 months ago
Good thought! Seems like it doesn't work for my use case, where this is a non-admin (bot) user that's been granted permission to push directly to the relevant branch:
pushRepo.permissions.admin === false
branchProtections
(can't fetch (because not admin?))branchRes.data.protected === true
I don't see a clear way in the API to detect that it's a protected branch, but OK for the currently auth'ed user (short of being admin)
Fixes #151
Does not include test coverage, but adding it would mean a number of large copy-pastes or a significant refactor of
src/edit-github-blob-test.ts