MCPcopy Create free account
hub / github.com/angular/dev-infra / getBranchesForLabel

Function getBranchesForLabel

ng-dev/pr/merge/integration.spec.ts:123–149  ·  view source on GitHub ↗
(
    name: string,
    githubTargetBranch = 'master',
  )

Source from the content-addressed store, hash-verified

121 }
122
123 async function getBranchesForLabel(
124 name: string,
125 githubTargetBranch = 'master',
126 ): Promise<string[] | null> {
127 const {mainBranchName, name: repoName, owner} = githubConfig;
128 const releaseTrains = await ActiveReleaseTrains.fetch({
129 name: repoName,
130 nextBranchName: mainBranchName,
131 owner,
132 api,
133 });
134 const labelConfigs = await getTargetLabelConfigsForActiveReleaseTrains(releaseTrains, api, {
135 github: githubConfig,
136 release: releaseConfig,
137 pullRequest: {
138 githubApiMerge: false,
139 },
140 __isNgDevConfigObject: true,
141 });
142 let label: TargetLabelConfig;
143 try {
144 label = await getMatchingTargetLabelConfigForPullRequest([name], labelConfigs);
145 } catch (error) {
146 return null;
147 }
148 return await getBranchesForTargetLabel(label, githubTargetBranch);
149 }
150
151 it('should detect "master" as branch for target: minor', async () => {
152 interceptBranchVersionRequest('master', '11.0.0-next.0');

Callers 1

Tested by

no test coverage detected