SvanBoxel / organization-workflows

Need to centrally manage and run Actions workflows across multiple repositories? This app does it for you.
ISC License
133 stars 33 forks source link

Un-enforcing status check doesn't work as expected #24

Closed alexandresavicki closed 3 years ago

alexandresavicki commented 3 years ago

Hi @SvanBoxel great job on this APP.

I found an possible bug when i configure enforce: true and enforce_admin: true, at this point everything works like a charm. But when i try to set enforce: false and enforce_admin: false after the workflow already created checks on protection branchs it keeps as true for all repositoryes in my organization.

It would be great if, after the change forces it to false, it is updated checks for all repositoires.

SvanBoxel commented 3 years ago

Bug confirmed. 👍🏽

At the moment the app copies all current required status checks as an array and then, depending on whether you enforce it or not, adds a new required check to that array. That means that even though you toggle the boolean from true to false, it will still be part of the original array of required checks.

Culprit: https://github.com/SvanBoxel/organization-workflows/blob/0227befa53ad36f2a182ee5f99c18e2a63cca8f9/src/utils/enforce-protection.ts#L39

SvanBoxel commented 3 years ago

Release with 1.3.0.