fix: current tag not taken into account (#329)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-02-28 15:24:18 +01:00 committed by GitHub
parent c127c9be61
commit b953231f81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 2 deletions

View File

@ -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

2
dist/index.js generated vendored
View File

@ -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') {

View File

@ -58,7 +58,7 @@ async function run(): Promise<void> {
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;
}