From e1634de1d0181c40d7ce306ca8e748b9cc4b9681 Mon Sep 17 00:00:00 2001 From: James Ives Date: Tue, 14 Jan 2020 15:14:15 -0500 Subject: [PATCH] Failing Build (#124) --- __tests__/git.test.ts | 6 +++--- lib/git.js | 2 ++ src/git.ts | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/__tests__/git.test.ts b/__tests__/git.test.ts index 7e671fcb..53d66be0 100644 --- a/__tests__/git.test.ts +++ b/__tests__/git.test.ts @@ -30,7 +30,7 @@ describe("git", () => { }); const call = await init(); - expect(execute).toBeCalledTimes(4); + expect(execute).toBeCalledTimes(6); expect(call).toBe("Initialization step complete..."); }); @@ -46,7 +46,7 @@ describe("git", () => { const call = await init(); - expect(execute).toBeCalledTimes(4); + expect(execute).toBeCalledTimes(6); expect(call).toBe("Initialization step complete..."); }); @@ -109,7 +109,7 @@ describe("git", () => { const call = await init(); - expect(execute).toBeCalledTimes(4); + expect(execute).toBeCalledTimes(6); expect(call).toBe("Initialization step complete..."); }); }); diff --git a/lib/git.js b/lib/git.js index 771179dd..bcd3475e 100644 --- a/lib/git.js +++ b/lib/git.js @@ -36,6 +36,8 @@ function init() { yield execute_1.execute(`git init`, constants_1.workspace); yield execute_1.execute(`git config user.name ${constants_1.action.name}`, constants_1.workspace); yield execute_1.execute(`git config user.email ${constants_1.action.email}`, constants_1.workspace); + yield execute_1.execute(`git remote rm origin`, constants_1.workspace); + yield execute_1.execute(`git remote add origin ${constants_1.repositoryPath}`, constants_1.workspace); yield execute_1.execute(`git fetch`, constants_1.workspace); } catch (error) { diff --git a/src/git.ts b/src/git.ts index f6c324b0..08a96012 100644 --- a/src/git.ts +++ b/src/git.ts @@ -26,6 +26,8 @@ export async function init(): Promise { 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 remote rm origin`, workspace); + await execute(`git remote add origin ${repositoryPath}`, workspace); await execute(`git fetch`, workspace); } catch (error) { core.setFailed(`There was an error initializing the repository: ${error}`);