Tool to streamline content in a Github repository from a spec.
This is part of a blog post on how to administer multiple Github repositories.
Run dotnet tool install -g MBW.Tools.GhStandardContent
. After this, gh-standard-content
should be in your PATH.
Read more on the blog post about managing standardized content on Github repositories. In short, you need a Github token and a repos.json
file which describes your content.
Create a repos.json
with the following:
{
"content": {
// Define as many sets of files as you want
"standardContent": {
".gitignore": "standard_content\\.gitignore"
},
// Each set can describe multiple files, and where they're located locally
"standardDotnetNuget": {
// To modify workflow files, you need a special scope: workflow
".github/workflows/dotnet.yml": "standard_content\\dotnet.yml",
".github/workflows/nuget.yml": "standard_content\\nuget.yml",
"Directory.Build.props": "standard_content\\Directory.Build.props"
}
},
"repositories": {
// Describe each repository, with a property indicating that a set applies.
"LordMike/MBW.Client.BlueRiiotApi": {
"standardContent": true,
"standardDotnetNuget": true
},
...
}
}
Run the tool with gh-standard-content -t My_Token repos.json
to create pull requests on all repositories that are out of date.
Run gh-standard-content --help
for more parameters.