Fix workdir (#224)

This commit is contained in:
CrazyMax 2020-06-24 02:24:58 +02:00
parent 044b9d4d64
commit 8708f57399
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
3 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## 2.1.1 (2020/06/24)
* Fix workdir (#224)
## 2.1.0 (2020/06/15) ## 2.1.0 (2020/06/15)
* Implement (optional) semver parsing of version (#213) * Implement (optional) semver parsing of version (#213)

6
dist/index.js generated vendored
View File

@ -1419,13 +1419,13 @@ function run() {
const args = core.getInput('args', { required: true }); const args = core.getInput('args', { required: true });
const workdir = core.getInput('workdir') || '.'; const workdir = core.getInput('workdir') || '.';
const goreleaser = yield installer.getGoReleaser(version); 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 !== '.') { if (workdir && workdir !== '.') {
core.info(`📂 Using ${workdir} as working directory...`); core.info(`📂 Using ${workdir} as working directory...`);
process.chdir(workdir); process.chdir(workdir);
} }
const commit = yield git.getShortCommit();
const tag = yield git.getTag();
const isTagDirty = yield git.isTagDirty(tag);
let snapshot = ''; let snapshot = '';
if (args.split(' ').indexOf('release') > -1) { if (args.split(' ').indexOf('release') > -1) {
if (isTagDirty) { if (isTagDirty) {

View File

@ -10,15 +10,15 @@ async function run(): Promise<void> {
const workdir = core.getInput('workdir') || '.'; const workdir = core.getInput('workdir') || '.';
const goreleaser = await installer.getGoReleaser(version); 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 !== '.') { if (workdir && workdir !== '.') {
core.info(`📂 Using ${workdir} as working directory...`); core.info(`📂 Using ${workdir} as working directory...`);
process.chdir(workdir); process.chdir(workdir);
} }
const commit = await git.getShortCommit();
const tag = await git.getTag();
const isTagDirty = await git.isTagDirty(tag);
let snapshot = ''; let snapshot = '';
if (args.split(' ').indexOf('release') > -1) { if (args.split(' ').indexOf('release') > -1) {
if (isTagDirty) { if (isTagDirty) {