Skip to content

Commit 420aea0

Browse files
Update release pipeline to use correct test project branch (#443)
2 parents 0cdedd5 + 1ae30d8 commit 420aea0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

scripts/release/createNativeModules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ async function updateNativeComponentsTestProject(moduleInfo, tmpFolder, nativeWi
138138
const tmpFolderActions = join(tmpFolder, `javascriptsource/${moduleInfo.moduleFolderNameInModeler}/actions`);
139139

140140
console.log("Updating NativeComponentsTestProject...");
141-
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder);
141+
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder, moduleInfo.testProjectBranchName);
142142

143143
console.log("Deleting existing JS Actions from test project...");
144144
await rm(tmpFolderActions, { force: true, recursive: true }); // this is useful to avoid retaining stale dependencies in the test project.
@@ -208,7 +208,7 @@ async function updateNativeComponentsTestProjectWithAtlas(moduleInfo, tmpFolder)
208208
const tmpFolderNativeStyles = join(tmpFolder, `themesource/${moduleInfo.moduleFolderNameInModeler}`);
209209

210210
console.log("Updating NativeComponentsTestProject..");
211-
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder);
211+
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder, moduleInfo.testProjectBranchName);
212212

213213
console.log("Copying Native styling files..");
214214
await Promise.all([

scripts/release/module-automation/commons.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function getFiles(folder: string, extensions?: string[]): Promise<string[
88

99
export function getPackageInfo(folder: string): Promise<any>;
1010

11-
export function cloneRepo(githubUrl: string, localFolder: string, branchName?: string): Promise<void>;
11+
export function cloneRepo(githubUrl: string, localFolder: string, branchName: string): Promise<void>;
1212

1313
export function createMPK(tmpFolder: string, moduleInfo: any, excludeFilesRegExp: RegExp): Promise<string>;
1414

scripts/release/module-automation/commons.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,13 @@ async function githubAuthentication(moduleInfo) {
207207
await execShellCommand(`echo "${process.env.GH_PAT}" | gh auth login --with-token`);
208208
}
209209

210-
async function cloneRepo(githubUrl, localFolder) {
210+
async function cloneRepo(githubUrl, localFolder, branchName) {
211211
const githubUrlDomain = githubUrl.replace("https://", "");
212212
const githubUrlAuthenticated = `https://${process.env.GH_USERNAME}:${process.env.GH_PAT}@${githubUrlDomain}`;
213213
await rm(localFolder, { recursive: true, force: true });
214214
await mkdir(localFolder, { recursive: true });
215-
await execShellCommand(`git clone ${githubUrlAuthenticated} ${localFolder}`);
215+
const branchOption = branchName ? `-b ${branchName}` : "";
216+
await execShellCommand(`git clone ${branchOption} ${githubUrlAuthenticated} ${localFolder}`);
216217
await setLocalGitCredentials(localFolder);
217218
}
218219

0 commit comments

Comments
 (0)