Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/release/createNativeModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async function updateNativeComponentsTestProject(moduleInfo, tmpFolder, nativeWi
const tmpFolderActions = join(tmpFolder, `javascriptsource/${moduleInfo.moduleFolderNameInModeler}/actions`);

console.log("Updating NativeComponentsTestProject...");
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder);
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder, moduleInfo.testProjectBranchName);

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

console.log("Updating NativeComponentsTestProject..");
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder);
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder, moduleInfo.testProjectBranchName);

console.log("Copying Native styling files..");
await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/module-automation/commons.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function getFiles(folder: string, extensions?: string[]): Promise<string[

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

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

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

Expand Down
5 changes: 3 additions & 2 deletions scripts/release/module-automation/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,13 @@ async function githubAuthentication(moduleInfo) {
await execShellCommand(`echo "${process.env.GH_PAT}" | gh auth login --with-token`);
}

async function cloneRepo(githubUrl, localFolder) {
async function cloneRepo(githubUrl, localFolder, branchName) {
const githubUrlDomain = githubUrl.replace("https://", "");
const githubUrlAuthenticated = `https://${process.env.GH_USERNAME}:${process.env.GH_PAT}@${githubUrlDomain}`;
await rm(localFolder, { recursive: true, force: true });
await mkdir(localFolder, { recursive: true });
await execShellCommand(`git clone ${githubUrlAuthenticated} ${localFolder}`);
const branchOption = branchName ? `-b ${branchName}` : "";
await execShellCommand(`git clone ${branchOption} ${githubUrlAuthenticated} ${localFolder}`);
await setLocalGitCredentials(localFolder);
}

Expand Down
Loading