-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: create merge script config for components repo
Adds a merge script config for the components repo. Additionally, wires up a shorthand Yarn script for merging PRs
- Loading branch information
1 parent
b16ece5
commit d405bd6
Showing
2 changed files
with
43 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module.exports = () => { | ||
const {major, minor} = parseVersion(require('./package').version); | ||
const patchBranch = `${major}.${minor}.x`; | ||
const minorBranch = `${major}.x`; | ||
|
||
return { | ||
projectRoot: __dirname, | ||
repository: { | ||
user: 'angular', | ||
name: 'components', | ||
}, | ||
claSignedLabel: 'cla: yes', | ||
mergeReadyLabel: 'merge ready', | ||
labels: [ | ||
{ | ||
pattern: 'target: patch', | ||
branches: ['master', patchBranch], | ||
}, | ||
{ | ||
pattern: 'target: minor', | ||
branches: ['master', minorBranch], | ||
}, | ||
{ | ||
pattern: 'target: major', | ||
branches: ['master'], | ||
}, | ||
{ | ||
pattern: 'target: development-branch', | ||
// Merge PRs with the given label only into the target branch that has | ||
// been specified through the Github UI. | ||
branches: (target) => [target], | ||
} | ||
], | ||
} | ||
}; | ||
|
||
/** Converts a version string into an object. */ | ||
function parseVersion(version) { | ||
const [major = 0, minor = 0, patch = 0] = version.split('.').map(segment => parseInt(segment)); | ||
return {major, minor, patch}; | ||
} |
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