Skip to content

Commit

Permalink
Merge branch 'dev' into releases/v3
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Jan 8, 2020
2 parents 0da2cb4 + 6d7895d commit f1a21fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions __tests__/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("git", () => {
});

const call = await init();
expect(execute).toBeCalledTimes(4);
expect(execute).toBeCalledTimes(3);
expect(call).toBe("Initialization step complete...");
});

Expand All @@ -46,7 +46,7 @@ describe("git", () => {

const call = await init();

expect(execute).toBeCalledTimes(4);
expect(execute).toBeCalledTimes(3);
expect(call).toBe("Initialization step complete...");
});

Expand Down Expand Up @@ -109,7 +109,7 @@ describe("git", () => {

const call = await init();

expect(execute).toBeCalledTimes(4);
expect(execute).toBeCalledTimes(3);
expect(call).toBe("Initialization step complete...");
});
});
Expand Down
4 changes: 2 additions & 2 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function generateBranch() {
yield util_1.execute(`git reset --hard`, constants_1.workspace);
yield util_1.execute(`git commit --allow-empty -m "Initial ${constants_1.action.branch} commit."`, constants_1.workspace);
yield util_1.execute(`git push ${constants_1.repositoryPath} ${constants_1.action.branch}`, constants_1.workspace);
yield switchToBaseBranch();
yield util_1.execute(`git fetch`, constants_1.workspace);
}
catch (error) {
core.setFailed(`There was an error creating the deployment branch: ${error} ❌`);
Expand Down Expand Up @@ -97,7 +97,7 @@ function deploy() {
}
// Checks out the base branch to begin the deployment process.
yield switchToBaseBranch();
yield util_1.execute(`git fetch origin`, constants_1.workspace);
yield util_1.execute(`git fetch ${constants_1.repositoryPath}`, constants_1.workspace);
yield util_1.execute(`git worktree add --checkout ${temporaryDeploymentDirectory} origin/${constants_1.action.branch}`, constants_1.workspace);
// Ensures that items that need to be excluded from the clean job get parsed.
let excludes = "";
Expand Down
5 changes: 2 additions & 3 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export async function init(): Promise<any> {
await execute(`git init`, workspace);
await execute(`git config user.name ${action.name}`, workspace);
await execute(`git config user.email ${action.email}`, workspace);
await execute(`git fetch origin`, workspace);
} catch (error) {
core.setFailed(`There was an error initializing the repository: ${error}`);
} finally {
Expand Down Expand Up @@ -58,7 +57,7 @@ export async function generateBranch(): Promise<any> {
workspace
);
await execute(`git push ${repositoryPath} ${action.branch}`, workspace);
await switchToBaseBranch();
await execute(`git fetch`, workspace);
} catch (error) {
core.setFailed(
`There was an error creating the deployment branch: ${error} ❌`
Expand Down Expand Up @@ -89,7 +88,7 @@ export async function deploy(): Promise<any> {

// Checks out the base branch to begin the deployment process.
await switchToBaseBranch();
await execute(`git fetch origin`, workspace);
await execute(`git fetch ${repositoryPath}`, workspace);
await execute(
`git worktree add --checkout ${temporaryDeploymentDirectory} origin/${action.branch}`,
workspace
Expand Down

0 comments on commit f1a21fd

Please sign in to comment.