From b953231f81b8dfd023c58e0854a721e35037f28b Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Mon, 28 Feb 2022 15:24:18 +0100 Subject: [PATCH] fix: current tag not taken into account (#329) Co-authored-by: CrazyMax --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ dist/index.js | 2 +- src/main.ts | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1778261b..7f671d3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,3 +174,25 @@ jobs: with: name: myapp path: ./test/dist/* + + current-tag: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - + name: GoReleaser + uses: ./ + with: + args: release --skip-publish --rm-dist + workdir: ./test + env: + GORELEASER_CURRENT_TAG: v1.2.3 diff --git a/dist/index.js b/dist/index.js index 45d17d3c..598ad4f5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -477,7 +477,7 @@ function run() { } yield exec.exec(`${bin} ${inputs.args}${snapshot}`, undefined, { env: Object.assign({}, process.env, { - GORELEASER_CURRENT_TAG: tag || process.env.GORELEASER_CURRENT_TAG || '' + GORELEASER_CURRENT_TAG: process.env.GORELEASER_CURRENT_TAG || tag || '' }) }); if (typeof yamlfile === 'string') { diff --git a/src/main.ts b/src/main.ts index fb689ed5..7ee8bb6f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -58,7 +58,7 @@ async function run(): Promise { await exec.exec(`${bin} ${inputs.args}${snapshot}`, undefined, { env: Object.assign({}, process.env, { - GORELEASER_CURRENT_TAG: tag || process.env.GORELEASER_CURRENT_TAG || '' + GORELEASER_CURRENT_TAG: process.env.GORELEASER_CURRENT_TAG || tag || '' }) as { [key: string]: string; }