Snapshot forced if no tag found
This commit is contained in:
parent
04ed112080
commit
c71e1672a2
10
lib/main.js
10
lib/main.js
|
@ -25,8 +25,16 @@ function run() {
|
||||||
const version = core.getInput('version') || 'latest';
|
const version = core.getInput('version') || 'latest';
|
||||||
const args = core.getInput('args');
|
const args = core.getInput('args');
|
||||||
const goreleaser = yield installer.getGoReleaser(version);
|
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...');
|
console.log('🏃 Running GoReleaser...');
|
||||||
yield exec.exec(`${goreleaser} ${args}`);
|
yield exec.exec(`${goreleaser} ${args}${snapshot}`);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -8,8 +8,16 @@ async function run() {
|
||||||
const args = core.getInput('args');
|
const args = core.getInput('args');
|
||||||
const goreleaser = await installer.getGoReleaser(version);
|
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...');
|
console.log('🏃 Running GoReleaser...');
|
||||||
await exec.exec(`${goreleaser} ${args}`);
|
await exec.exec(`${goreleaser} ${args}${snapshot}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue