From 8708f5739924b7f505108288dbb66723d4dfe2ae Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Wed, 24 Jun 2020 02:24:58 +0200 Subject: [PATCH] Fix workdir (#224) --- CHANGELOG.md | 4 ++++ dist/index.js | 6 +++--- src/main.ts | 8 ++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4a50922..d1e4b058 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.1.1 (2020/06/24) + +* Fix workdir (#224) + ## 2.1.0 (2020/06/15) * Implement (optional) semver parsing of version (#213) diff --git a/dist/index.js b/dist/index.js index dd39e534..1e58fce3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1419,13 +1419,13 @@ function run() { const args = core.getInput('args', { required: true }); const workdir = core.getInput('workdir') || '.'; const goreleaser = yield installer.getGoReleaser(version); - const commit = yield git.getShortCommit(); - const tag = yield git.getTag(); - const isTagDirty = yield git.isTagDirty(tag); if (workdir && workdir !== '.') { core.info(`📂 Using ${workdir} as working directory...`); process.chdir(workdir); } + const commit = yield git.getShortCommit(); + const tag = yield git.getTag(); + const isTagDirty = yield git.isTagDirty(tag); let snapshot = ''; if (args.split(' ').indexOf('release') > -1) { if (isTagDirty) { diff --git a/src/main.ts b/src/main.ts index f23129a0..eee5af93 100644 --- a/src/main.ts +++ b/src/main.ts @@ -10,15 +10,15 @@ async function run(): Promise { const workdir = core.getInput('workdir') || '.'; const goreleaser = await installer.getGoReleaser(version); - const commit = await git.getShortCommit(); - const tag = await git.getTag(); - const isTagDirty = await git.isTagDirty(tag); - if (workdir && workdir !== '.') { core.info(`📂 Using ${workdir} as working directory...`); process.chdir(workdir); } + const commit = await git.getShortCommit(); + const tag = await git.getTag(); + const isTagDirty = await git.isTagDirty(tag); + let snapshot = ''; if (args.split(' ').indexOf('release') > -1) { if (isTagDirty) {