Add 'NO-PULL' feature (#150)

* feat(pull_strategy): add `NO-PULL` option

* fix: add additional NO-PULL debug log
This commit is contained in:
Federico Grandi
2021-03-03 09:00:13 +01:00
committed by GitHub
parent 17b09154e6
commit f5554ef7f0
4 changed files with 21 additions and 13 deletions

View File

@@ -50,15 +50,18 @@ console.log(`Running in ${baseDir}`)
.checkout(getInput('branch'), undefined, log)
.catch(() => git.checkoutLocalBranch(getInput('branch'), log))
info('> Pulling from remote...')
await git.fetch(undefined, log).pull(
undefined,
undefined,
{
[getInput('pull_strategy')]: null
},
log
)
if (getInput('pull_strategy') == 'NO-PULL') info('> Not pulling from repo.')
else {
info('> Pulling from remote...')
await git.fetch(undefined, log).pull(
undefined,
undefined,
{
[getInput('pull_strategy')]: null
},
log
)
}
info('> Re-staging files...')
if (getInput('add')) await add({ ignoreErrors: true })
@@ -257,6 +260,11 @@ async function checkInputs() {
}
// #endregion
// #region pull_strategy
if (getInput('pull_strategy') == 'NO-PULL')
debug("NO-PULL found: won't pull from remote.")
// #endregion
// #region push
if (getInput('push')) {
// It has to be either 'true', 'false', or any other string (use as arguments)