Failing Build (#124)

This commit is contained in:
James Ives 2020-01-14 15:14:15 -05:00 committed by GitHub
parent 4a7ca37984
commit e1634de1d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -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...");
});
});

View File

@ -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) {

View File

@ -26,6 +26,8 @@ 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 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}`);