github / safe-settings

ISC License
561 stars 137 forks source link

Safe-settings reapplies collaborator maintain permissions #636

Open patrick-premont opened 1 month ago

patrick-premont commented 1 month ago

Problem Description

The collaborator plugin reads the current permissions from the dict of booleans permissions and regenerates the permission string from it. But this logic only support 3 of the 5 built-in roles.

What is actually happening

This leads to safe-settings performing unnecessary updates when it processes repositories with collaborators that have the maintain role, for instance.

What is the expected behavior

All 5 built-in roles should be supported so that safe-setting only performs updates of collaboration permissions when necessary.

If it is exposed to the application, it would be preferable to read the permission field returned by GitHub directly. This would support all roles, including custom ones.