Description
Prerequisites:
- Is the functionality available in the GitHub UI? If so, please provide a link to information about the feature.
Yes here
- Is the functionality available through the GitHub API? If the functionality is available, please provide links to the
API documentation (https://developer.github.com/v3/) as well as the Octokit documentation (https://octokit.github.io/).
API "visibility" here
Octokit "Get a repository" here
Code Example to get visibility for all repos and match to the visibility config
const repos = await octokit.rest.repos.listForOrg({
org: org
})
for (var i = 0; i < repos.data.length; i++)
{
const repoName = repos.data[i].name
const results = await octokit.rest.repos.get({
owner: org,
repo: repoName
});
switch (results.data.visibility) {
case 'private':
console.log(`Applying private.yml to ` + repoName);
break;
case 'public' :
console.log(`Applying public.yml to ` + repoName);
break;
case 'internal' :
console.log(`Applying internal.yml to ` + repoName);
break;
default:
console.log(`Error accessing visibility for ` + repoName);
}
}
New Feature
Our organization requires different configurations for the different visibility options (public repos, private repos, internal repos).
For example:
We require a license file for all public repos, however this is not required for private or internal repos.
I did not see any documentation or code that alluded to this being a configuration option in the current state of Safe-Settings. Therefore, I am working on an enhancement in our forked version of Safe-Settings that would evaluate the various settings files in the following order:
settings.yml (org wide) -> (suborgs) -> visibility configurations (private.yml, public.yml, internal.yml) -> repos/(repo-name).yml
Would anyone else be interested in this feature? If so, please provide feedback, suggestions, etc.