Skip to content
Merged
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
58 changes: 58 additions & 0 deletions .github/rulesets/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "main",
"target": "branch",
"enforcement": "active",
"conditions": {
"ref_name": {
"exclude": [],
"include": [
"~DEFAULT_BRANCH"
]
}
},
"rules": [
{
"type": "deletion"
},
{
"type": "required_linear_history"
},
{
"type": "pull_request",
"parameters": {
"required_approving_review_count": 0,
"dismiss_stale_reviews_on_push": true,
"require_code_owner_review": false,
"require_last_push_approval": false,
"required_review_thread_resolution": false,
"allowed_merge_methods": [
"squash",
"rebase"
]
}
},
{
"type": "required_status_checks",
"parameters": {
"strict_required_status_checks_policy": true,
"do_not_enforce_on_create": false,
"required_status_checks": [
{
"context": "checks",
"integration_id": 15368
}
]
}
},
{
"type": "non_fast_forward"
}
],
"bypass_actors": [
{
"actor_id": 5,
"actor_type": "RepositoryRole",
"bypass_mode": "always"
}
]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ format-source # format code source
install # run install tasks
install-hooks # install git hooks
install-project # install the project
install-rulesets # install github rulesets

[mlflow]
mlflow # run mlflow tasks
Expand Down
10 changes: 10 additions & 0 deletions tasks/install.just
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ install-hooks:
[group('install')]
install-project:
uv sync --all-groups

# install github rulesets
[group('install')]
install-rulesets:
#!/usr/bin/env bash
set -euo pipefail
repo=$(gh repo view --json=name --jq=.name)
owner=$(gh repo view --json=owner --jq=.owner.login)
gh api --method POST -H "Accept: application/vnd.github+json" \
"/repos/$owner/$repo/rulesets" --input=".github/rulesets/main.json"
Comment on lines +23 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider adding a comment explaining what this command does, and what the expected output is. This will help future developers understand the purpose of this command.

    gh api --method POST -H "Accept: application/vnd.github+json" \
    "/repos/$owner/$repo/rulesets" --input=".github/rulesets/main.json" # Creates or updates the ruleset for the repository