This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(settings): simplified repo settings by extending org level settings
BREAKING CHANGE: it is now assumed that there is an account level settings definition, so fewer details are defined per project. if settings are not defined in a .github repo, most of the config will no longer be applied closes #4
- Loading branch information
Showing
4 changed files
with
13 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,11 @@ | ||
import {info} from '@travi/cli-messages'; | ||
import writeYaml from '../third-party-wrappers/write-yaml'; | ||
|
||
export default function scaffoldSettings(projectRoot, name, description, homepage, visibility, projectType) { | ||
export default function scaffoldSettings(projectRoot, name, description, homepage, visibility) { | ||
info('Writing settings file', {level: 'secondary'}); | ||
|
||
return writeYaml(`${projectRoot}/.github/settings.yml`, { | ||
repository: { | ||
name, | ||
description, | ||
homepage, | ||
private: 'Public' !== visibility, | ||
has_wiki: false, | ||
has_projects: false, | ||
has_downloads: false, | ||
allow_squash_merge: false, | ||
allow_merge_commit: true, | ||
allow_rebase_merge: true | ||
}, | ||
labels: [ | ||
{name: 'bug', color: 'ee0701'}, | ||
{name: 'duplicate', color: 'cccccc'}, | ||
{name: 'enhancement', color: '84b6eb'}, | ||
{name: 'help wanted', color: '128A0C'}, | ||
{name: 'invalid', color: 'e6e6e6'}, | ||
{name: 'question', color: 'cc317c'}, | ||
{name: 'wontfix', color: 'ffffff'}, | ||
{name: 'breaking change', color: 'e0fc28'}, | ||
('JavaScript' === projectType) ? {name: 'greenkeeper', color: '00c775'} : undefined | ||
].filter(Boolean), | ||
branches: [ | ||
{ | ||
name: 'master', | ||
protection: { | ||
required_pull_request_reviews: null, | ||
required_status_checks: null, | ||
restrictions: null, | ||
enforce_admins: true | ||
} | ||
} | ||
] | ||
}); | ||
return writeYaml( | ||
`${projectRoot}/.github/settings.yml`, | ||
{_extends: '.github', repository: {name, description, homepage, private: 'Public' !== visibility}} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters