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

Function setRepoMergeMode

ng-dev/utils/git/repository-merge-mode.ts:47–77  ·  view source on GitHub ↗
(value: MergeMode)

Source from the content-addressed store, hash-verified

45}
46
47export async function setRepoMergeMode(value: MergeMode) {
48 const currentValue = await getCurrentMergeMode();
49 if (currentValue === value) {
50 Log.debug(
51 'Skipping update of repository configuration value as it is already set to the provided value',
52 );
53 return false;
54 }
55 const git = await AuthenticatedGitClient.get();
56 if (!mergeModes.includes(value)) {
57 throw Error(
58 `Unable to update ${mergeModePropertyName}. The value provided must use one of: ` +
59 `${mergeModes.join(', ')}\nBut "${value}" was provided as the value`,
60 );
61 }
62
63 // All members of the github team, `team` have been assigned the custom role `Custom Property
64 // Editor` allowing their accounts to update the values the custom properties in Angular repos.
65 await git.github.repos.customPropertiesForReposCreateOrUpdateRepositoryValues({
66 owner: git.remoteConfig.owner,
67 repo: git.remoteConfig.name,
68 properties: [
69 {
70 property_name: mergeModePropertyName,
71 value,
72 },
73 ],
74 });
75
76 return true;
77}

Callers 3

resetMergeModeFunction · 0.90
setMergeModeReleaseFunction · 0.90
verifyMergeModeFunction · 0.90

Calls 2

getCurrentMergeModeFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected