Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/rulesets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Repository rulesets

Source-of-truth JSON for branch rulesets applied to `pytorch/rl`.

These files are **not** auto-applied by GitHub. They live here so the configuration
is reviewable, version-controlled, and reproducible. To apply a ruleset:

```bash
gh api -X POST repos/pytorch/rl/rulesets --input .github/rulesets/<file>.json
```

To update an existing ruleset, fetch its id and `PUT`:

```bash
gh api repos/pytorch/rl/rulesets -q '.[] | select(.name=="<name>") | .id'
gh api -X PUT repos/pytorch/rl/rulesets/<id> --input .github/rulesets/<file>.json
```

To delete:

```bash
gh api -X DELETE repos/pytorch/rl/rulesets/<id>
```

## Current rulesets

- `lint-required.json` — gates merges into `main` / `nightly` / `release/*` on
the `lint-done` aggregator from `.github/workflows/lint.yml` and the existing
`Meta CLA Check`.
24 changes: 24 additions & 0 deletions .github/rulesets/lint-required.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Require lint on protected branches",
"target": "branch",
"enforcement": "active",
"conditions": {
"ref_name": {
"include": ["refs/heads/main", "refs/heads/nightly", "refs/heads/release/*"],
"exclude": []
}
},
"rules": [
{
"type": "required_status_checks",
"parameters": {
"strict_required_status_checks_policy": false,
"do_not_enforce_on_create": false,
"required_status_checks": [
{ "context": "lint-done" },
{ "context": "Meta CLA Check", "integration_id": 1425812 }
]
}
}
]
}
Loading