-
Notifications
You must be signed in to change notification settings - Fork 157
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
Rulesets cannot be set for all repos when the org does not have an enterprise subscription #553
Comments
also having this issue with GitHub Team subscription |
I have found this too. A bit concerning as I suspect GitHub might full deprecate classic branch protection at some point. |
@cachedout @raleonardo @paddyroddy I also just started trying out rulesets and have so far only used it in repo specific settings files. The behavior you describe is actually mentioned in the README. Maybe it's not super clear, but the rulesets defined in the You should be able to use repo level rulesets by defining a suborg that includes the desired repositories by using a glob pattern. If you don't have any suborgs or repo level override files, then you should be able to do something like this: File: # "Sub organization" for trying out repo level rulesets
suborgrepos:
- *
rulesets:
# demo ruleset with some random settings
- name: my-repo-level-ruleset
target: branch
enforcement: active
conditions:
ref_name:
include:
- "refs/heads/main"
exclude:
- "refs/heads/[0-9]*.[0-9x]*.x"
bypass:
actors:
users:
- "dependabot"
current_user_can_bypass: never
description: |
Repository-level ruleset applied to a glob pattern of repos.
rules:
- type: required_linear_history
- type: required_signatures
- type: deletion
- type: update
- type: creation
- type: non_fast_forward
- type: pull_request
parameters:
required_approving_review_count: 1
dismiss_stale_reviews_on_push: true
require_code_owner_review: true
require_last_push_approval: true
required_review_thread_resolution: true
automatic_copilot_code_review_enabled: true
- type: required_status_checks
parameters:
strict_required_status_checks_policy: true
do_not_enforce_on_create: true
required_status_checks:
- context: ci
- context: lint Disclaimer: I don't know how this will work if you have defined the same ruleset in both the suborg and a repo level settings file. With branch protections you could have it defined on the suborg level and then just override the required status checks. I'm not sure if you can do that with the rulesets and the rules (or if you have to define the complete required_status_checks rule in every repo settings file). EDIT: FWIW, suborg rulesets are also mentioned here #597 (comment) |
@anderssonjohan thanks! Will give this a go today |
Nice that worked well https://github.com/UCL-MIRSG/.github/blob/main/safe-settings/suborgs/rulesets.yaml |
Problem Description
When the GitHub organization does not have an enterprise subscription, it is not possible to set rulesets for all repos in the organization.
What is actually happening
What happens is that safe-settings queries
https://api.github.com/orgs/<my_org>/rulesets
and the API returns a 403 with a message that reads:Upgrade to GitHub Enterprise to enable this feature.
. This prevents the use of safe-settings to apply rulesets to all individual repos in the org.What is the expected behavior
It is expected that safe-settings should allow a user to set a ruleset for all repos in an organization by controlling rulesets on all repos in the org instead of via the org-level rulesets.
Error output, if available
Context
This may well be the intended behavior and if so, it would be good to make this clear in the documentation.
Are you using the hosted instance of probot/settings or running your own?
Self-hosting
If running your own instance, are you using it with github.com or GitHub Enterprise?
github.com
Version of probot/settings
Probot v12.3.1 (Node.js: v16.20.2)
Version of GitHub Enterprise
N/A
The text was updated successfully, but these errors were encountered: