mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-07-09 18:37:32 +00:00
feat!: remove auto-snapshot on dirty tag (#382)
* feat!: remove auto-snapshot on dirty tag Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> * feat!: remove the entire git thing Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> * fix: tests Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> * test: fix Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> * fix: snapshto tests Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
23e0ed5919
commit
3b7d1ba946
+1
-18
@@ -2,7 +2,6 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import yargs from 'yargs';
|
||||
import * as context from './context';
|
||||
import * as git from './git';
|
||||
import * as goreleaser from './goreleaser';
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
@@ -28,10 +27,6 @@ async function run(): Promise<void> {
|
||||
process.chdir(inputs.workdir);
|
||||
}
|
||||
|
||||
const commit = await git.getShortCommit();
|
||||
const tag = await git.getTag();
|
||||
const isTagDirty = await git.isTagDirty(tag);
|
||||
|
||||
let yamlfile: string | unknown;
|
||||
const argv = yargs.parse(inputs.args);
|
||||
if (argv.config) {
|
||||
@@ -44,19 +39,7 @@ async function run(): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
let snapshot = '';
|
||||
if (inputs.args.split(' ').indexOf('release') > -1) {
|
||||
if (isTagDirty) {
|
||||
if (!inputs.args.includes('--snapshot') && !inputs.args.includes('--nightly')) {
|
||||
core.info(`No tag found for commit ${commit}. Snapshot forced`);
|
||||
snapshot = ' --snapshot';
|
||||
}
|
||||
} else {
|
||||
core.info(`${tag} tag found for commit ${commit}`);
|
||||
}
|
||||
}
|
||||
|
||||
await exec.exec(`${bin} ${inputs.args}${snapshot}`);
|
||||
await exec.exec(`${bin} ${inputs.args}`);
|
||||
|
||||
if (typeof yamlfile === 'string') {
|
||||
const artifacts = await goreleaser.getArtifacts(await goreleaser.getDistPath(yamlfile));
|
||||
|
||||
Reference in New Issue
Block a user