Add install-only test job and fix action.yml

This commit is contained in:
CrazyMax
2020-11-06 21:18:48 +01:00
parent 3f5ecc4e17
commit 3d57a20621
4 changed files with 45 additions and 9 deletions
+5 -2
View File
@@ -7,17 +7,20 @@ import {dirname} from 'path';
async function run(): Promise<void> {
try {
const version = core.getInput('version') || 'latest';
const isInstallOnly = /^true$/i.test(core.getInput('install-only'));
const args = core.getInput('args');
const workdir = core.getInput('workdir') || '.';
const isInstallOnly = /^true$/i.test(core.getInput('install-only'));
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;
} else if (!args) {
throw new Error('args input required');
}
const args = core.getInput('args', {required: true});
if (workdir && workdir !== '.') {
core.info(`📂 Using ${workdir} as working directory...`);