feat(git): repo inits
This commit is contained in:
parent
3f772138f2
commit
fab931ad59
4 changed files with 42 additions and 2195 deletions
34
config/github/ruleset.json
Normal file
34
config/github/ruleset.json
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"name": "main",
|
||||
"target": "branch",
|
||||
"enforcement": "active",
|
||||
"conditions": {
|
||||
"ref_name": {
|
||||
"exclude": [],
|
||||
"include": ["~DEFAULT_BRANCH"]
|
||||
}
|
||||
},
|
||||
"rules": [
|
||||
{ "type": "deletion" },
|
||||
{ "type": "non_fast_forward" },
|
||||
{
|
||||
"type": "pull_request",
|
||||
"parameters": {
|
||||
"required_approving_review_count": 1,
|
||||
"dismiss_stale_reviews_on_push": true,
|
||||
"required_reviewers": [],
|
||||
"require_code_owner_review": false,
|
||||
"require_last_push_approval": true,
|
||||
"required_review_thread_resolution": true,
|
||||
"allowed_merge_methods": ["squash", "rebase"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"bypass_actors": [
|
||||
{
|
||||
"actor_id": 5,
|
||||
"actor_type": "RepositoryRole",
|
||||
"bypass_mode": "always"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -225,14 +225,7 @@ return {
|
|||
},
|
||||
},
|
||||
platforms = {
|
||||
kattis = { default_language = 'cpp' },
|
||||
codeforces = {
|
||||
enabled_languages = { 'cpp', 'python' },
|
||||
default_language = 'cpp',
|
||||
},
|
||||
atcoder = {
|
||||
enabled_languages = { 'cpp', 'python' },
|
||||
default_language = 'cpp',
|
||||
overrides = {
|
||||
cpp = {
|
||||
template = '~/.config/nix/config/cp/template_single.cc',
|
||||
|
|
@ -246,8 +239,6 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
usaco = { default_language = 'cpp' },
|
||||
codechef = { default_language = 'cpp' },
|
||||
},
|
||||
ui = {
|
||||
picker = 'fzf-lua',
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -122,14 +122,21 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
xdg.configFile."github/ruleset.json".source =
|
||||
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/nix/config/github/ruleset.json";
|
||||
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
git_protocol = "https";
|
||||
prompt = "enabled";
|
||||
aliases = {
|
||||
init = "!gh api --method PATCH /repos/\"$1\" -f delete_branch_on_merge=true -f allow_squash_merge=true -f allow_merge_commit=false -f allow_rebase_merge=true -f allow_auto_merge=true -f allow_update_branch=true -f squash_merge_commit_title=PR_TITLE -f squash_merge_commit_message=BLANK > /dev/null && gh api --method POST /repos/\"$1\"/rulesets --input ${config.xdg.configHome}/github/ruleset.json > /dev/null && echo \"done: $1\"";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
enableDefaultConfig = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue