mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-07-09 16:17:34 +00:00
Snapshot forced if no tag found
This commit is contained in:
+9
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user