Snapshot forced if no tag found

This commit is contained in:
CrazyMax 2019-09-20 23:08:16 +02:00
parent 04ed112080
commit c71e1672a2
2 changed files with 18 additions and 2 deletions

View File

@ -25,8 +25,16 @@ function run() {
const version = core.getInput('version') || 'latest';
const args = core.getInput('args');
const goreleaser = yield installer.getGoReleaser(version);
let snapshot = '';
if (!process.env.GITHUB_REF.startsWith('refs/tags/')) {
console.log(`⚠️ No tag found. Snapshot forced`);
snapshot = ' --snapshot';
}
else {
console.log(`${process.env.GITHUB_REF.split('/')[2]}} tag found`);
}
console.log('🏃 Running GoReleaser...');
yield exec.exec(`${goreleaser} ${args}`);
yield exec.exec(`${goreleaser} ${args}${snapshot}`);
}
catch (error) {
core.setFailed(error.message);

View File

@ -8,8 +8,16 @@ async function run() {
const args = core.getInput('args');
const goreleaser = await installer.getGoReleaser(version);
let snapshot = '';
if (!process.env.GITHUB_REF!.startsWith('refs/tags/')) {
console.log(`⚠️ No tag found. Snapshot forced`);
snapshot = ' --snapshot';
} else {
console.log(`${process.env.GITHUB_REF!.split('/')[2]}} tag found`);
}
console.log('🏃 Running GoReleaser...');
await exec.exec(`${goreleaser} ${args}`);
await exec.exec(`${goreleaser} ${args}${snapshot}`);
} catch (error) {
core.setFailed(error.message);
}