Skip to content

rulesets: add default branch protection for all repositories #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wolfgangwalther
Copy link
Contributor

This adds a default branch protection ruleset for all (existing and future) repositories in the NixOS org. It only targets the default branch and disallows deletion and force pushes.

This seems like a reasonable default and I doubt that any repositories depend on being able to do either of that. And if they do, it's doubtful, whether these repositories are in the right place in the NixOS org.

This needs to be imported on the organization level, via Settings -> Repository -> Rulesets.

This adds a default branch protection ruleset for *all* (existing and
future) repositories in the NixOS org. It only targets the default
branch and disallows deletion and force pushes.
@wolfgangwalther wolfgangwalther requested a review from a team as a code owner July 24, 2025 07:21
@wolfgangwalther
Copy link
Contributor Author

I tried adding to the export.bash script to also export this default ruleset, but it seems like API access is only enabled for GitHub Teams:

% gh api /orgs/infinisil-test-org/rulesets
gh: Upgrade to GitHub Team to enable this feature. (HTTP 403)

Thus I can't test what the response looks like etc.

Since this is only a single rule, maybe exporting it once is not too bad. Alternatively, @infinisil, you could look into that and adjust the export script accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant