forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ng-dev-config.ts
64 lines (60 loc) · 2.08 KB
/
.ng-dev-config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import {MergeConfig} from '@angular/dev-infra-private/pr/merge/config';
import {determineMergeBranches} from '@angular/dev-infra-private/pr/merge/determine-merge-branches';
import {GithubConfig} from '@angular/dev-infra-private/utils/config';
/**
* Github configuration for the ng-dev command. This repository is
* uses as remote for the merge script.
*/
const github: GithubConfig = {
owner: 'angular',
name: 'components'
};
/**
* Configuration for the merge tool in `ng-dev`. This sets up the labels which
* are respected by the merge script (e.g. the target labels).
*/
const merge = (): MergeConfig => {
const currentVersion = require('./package.json').version;
// We use the `@angular/cdk` as source of truth for the latest published version in NPM.
// Any package from the monorepo could technically work and result in the same version.
const {minor, patch} = determineMergeBranches(currentVersion, '@angular/cdk');
return {
// By default, the merge script merges locally with `git cherry-pick` and autosquash.
// This has the downside of pull requests showing up as `Closed` instead of `Merged`.
// In the components repository, since we don't use fixup or squash commits, we can
// use the Github API merge strategy. That way we ensure that PRs show up as `Merged`.
githubApiMerge: {
default: 'squash',
labels: [
{pattern: 'preserve commits', method: 'rebase'}
]
},
claSignedLabel: 'cla: yes',
mergeReadyLabel: 'merge ready',
commitMessageFixupLabel: 'commit message fixup',
labels: [
{
pattern: 'target: patch',
branches: ['master', patch],
},
{
pattern: 'target: minor',
branches: ['master', minor],
},
{
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],
}
],
};
};
module.exports = {
github,
merge,
};