Manages files across repos in a GitHub org based on custom properties.
repo-content-updater license --github-token ghp_xxx
Applies a LICENSE template to all repos with the custom property manage-license set to yes. This is split out from the generic managed files so that the property can be set to required org wide and specific "yes" and "no" options (only) provided in a drop down, ensuring a repo either opts in or out of the license specifically.
repo-content-updater managed-files --github-token ghp_xxx
Looks for the managed-files custom property on a repo, and parses out a comma separated list of files/groups to include. Files must be referenced by their name in the config file, and groups should be referenced by their group name, prefixed with group:.
For example, the value could be: group:base,go-test. This would pull in the base group of files and the go-test file.
groups:
- name: base
templates:
- dep-review
- name: go
templates:
- go-makefile
- go-dependabot
files:
- name: go-makefile
template_name: go-makefile
repo_path: Makefile
- name: go-dependabot
template_name: go-dependabot.yml
repo_path: .github/dependabot.yml
alternate_paths:
- .github/dependabot.yaml
- name: dep-review
template_name: dependency-review.yml
repo_path: .github/workflows/dependency-review.yml
alternate_paths:
- .github/workflows/dependency-review.yamlgroups allows combining multiple items from files into a single group, making it easier to reference in the custom property
files is where every supported template must be listed.
nameis the name to reference the file by in groups or in the custom property.template_nameis the name of the template to use from the supplied templates directoryrepo_pathis the path within the repo to place the filealternate_pathsis a list of alternate/equivalent paths this template might have been named before being managed. These files will be renamed and updated to the latest version of the template, if present
If you need to override any of the default settings on a per-repo basis, you can create a .repo-content-updater.yaml file in the root of the repo, and configure any overrides there. It must be present in the default branch of the repo to be loaded.
pr_target_branchis the branch to target PRs against. This is the default branch by default, but if this is overridden in the repo, the branch will be created from and targeted against the supplied branchassign_usersis a list of GitHub users to assign the PR to instead of the default review team. If set, the default review team will not be used. This can be used (if desired) in combination with theassign_groupfield of the repo config fileassign_groupis a group to assign the created PRs to. This can be used (if desired) in combination with theassign_usersfield of the repo config filecommit_prefixwill set a common prefix on any commits generated by this tool.var_overrideswill override the default values for templates with values supplied here