From 3ddbf41de7a6fd80fcfd6ca61de629285a62868f Mon Sep 17 00:00:00 2001 From: James Ives Date: Tue, 14 Jan 2020 14:22:01 -0500 Subject: [PATCH] git fetch --- lib/git.js | 3 ++- src/git.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/git.js b/lib/git.js index afd807ce..771179dd 100644 --- a/lib/git.js +++ b/lib/git.js @@ -36,7 +36,7 @@ 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 fetch ${constants_1.repositoryPath}`, constants_1.workspace); + yield execute_1.execute(`git fetch`, constants_1.workspace); } catch (error) { core.setFailed(`There was an error initializing the repository: ${error}`); @@ -69,6 +69,7 @@ function generateBranch() { yield execute_1.execute(`git reset --hard`, constants_1.workspace); yield execute_1.execute(`git commit --allow-empty -m "Initial ${constants_1.action.branch} commit."`, constants_1.workspace); yield execute_1.execute(`git push ${constants_1.repositoryPath} ${constants_1.action.branch}`, constants_1.workspace); + yield execute_1.execute(`git fetch`, constants_1.workspace); } catch (error) { core.setFailed(`There was an error creating the deployment branch: ${error} ❌`); diff --git a/src/git.ts b/src/git.ts index 8290f481..f6c324b0 100644 --- a/src/git.ts +++ b/src/git.ts @@ -26,7 +26,7 @@ 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 fetch ${repositoryPath}`, workspace); + await execute(`git fetch`, workspace); } catch (error) { core.setFailed(`There was an error initializing the repository: ${error}`); } finally { @@ -62,6 +62,7 @@ export async function generateBranch(): Promise { workspace ); await execute(`git push ${repositoryPath} ${action.branch}`, workspace); + await execute(`git fetch`, workspace); } catch (error) { core.setFailed( `There was an error creating the deployment branch: ${error} ❌`