mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-07-07 18:37:31 +00:00
feat: Add install-only option for using goreleaser in user scripts (#252)
Co-authored-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
+10
-1
@@ -2,13 +2,22 @@ import * as git from './git';
|
||||
import * as installer from './installer';
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import {dirname} from 'path';
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
const version = core.getInput('version') || 'latest';
|
||||
const args = core.getInput('args', {required: true});
|
||||
const isInstallOnly = /^true$/i.test(core.getInput('install-only'));
|
||||
const workdir = core.getInput('workdir') || '.';
|
||||
const goreleaser = await installer.getGoReleaser(version);
|
||||
core.info(`✅ GoReleaser installed successfully`);
|
||||
if (isInstallOnly) {
|
||||
const goreleaserDir = dirname(goreleaser);
|
||||
core.addPath(goreleaserDir);
|
||||
core.debug(`Added ${goreleaserDir} to PATH`);
|
||||
return;
|
||||
}
|
||||
const args = core.getInput('args', {required: true});
|
||||
|
||||
if (workdir && workdir !== '.') {
|
||||
core.info(`📂 Using ${workdir} as working directory...`);
|
||||
|
||||
Reference in New Issue
Block a user