git fetch

This commit is contained in:
James Ives 2020-01-14 14:22:01 -05:00
parent b7e33f69fd
commit 3ddbf41de7
2 changed files with 4 additions and 2 deletions

View File

@ -36,7 +36,7 @@ function init() {
yield execute_1.execute(`git init`, constants_1.workspace); 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.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 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) { catch (error) {
core.setFailed(`There was an error initializing the repository: ${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 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 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 push ${constants_1.repositoryPath} ${constants_1.action.branch}`, constants_1.workspace);
yield execute_1.execute(`git fetch`, constants_1.workspace);
} }
catch (error) { catch (error) {
core.setFailed(`There was an error creating the deployment branch: ${error}`); core.setFailed(`There was an error creating the deployment branch: ${error}`);

View File

@ -26,7 +26,7 @@ export async function init(): Promise<any> {
await execute(`git init`, workspace); await execute(`git init`, workspace);
await execute(`git config user.name ${action.name}`, workspace); await execute(`git config user.name ${action.name}`, workspace);
await execute(`git config user.email ${action.email}`, workspace); await execute(`git config user.email ${action.email}`, workspace);
await execute(`git fetch ${repositoryPath}`, workspace); await execute(`git fetch`, workspace);
} catch (error) { } catch (error) {
core.setFailed(`There was an error initializing the repository: ${error}`); core.setFailed(`There was an error initializing the repository: ${error}`);
} finally { } finally {
@ -62,6 +62,7 @@ export async function generateBranch(): Promise<any> {
workspace workspace
); );
await execute(`git push ${repositoryPath} ${action.branch}`, workspace); await execute(`git push ${repositoryPath} ${action.branch}`, workspace);
await execute(`git fetch`, workspace);
} catch (error) { } catch (error) {
core.setFailed( core.setFailed(
`There was an error creating the deployment branch: ${error}` `There was an error creating the deployment branch: ${error}`