How to disable actions via API

I’m trying to identify how to automate disabling actions via the API. Our organization has too many repos to effectively manage manually, and we are using actions in two repos but no others. I need a way to automate disabling actions most places. I’ve checked the api references and I’m concerned this is not available leaving us with some hokey html-soup parsing to accomplish this.

@peter-hs ,

We have no API to disable GitHub Actions in organizations or repositories.

If you want to enable GitHub Actions on few specific repositories in an organization, you can set it easily by manual on the organization settings.

Navigate to Organization settings > Actions page, at the top “Actions permissions” section, you can see the Policies to allow you choose which repositories are permitted to use GitHub Actions.

Choose “Selected repositories”, then click the :gear: icon to choose the repositories you want to enable GitHub Actions.

Under this setting in the organization, only the selected repositories can use GitHub Actions, other repositories and new created repositories can’t use GitHub Actions.

@peter-hs ,

How are thing going?
Have you tried my above suggestion that go to the Organization settings page to choose the repositories you want to enable GitHub Actions?
Is it helpful to you? Please try it, and if you have any questions about this topic, feel free to tell us.