mirror of
https://github.com/goreleaser/goreleaser-action.git
synced 2026-05-14 14:50:32 +00:00
feat: warn about using 'latest'
This commit is contained in:
parent
62d4b8ad34
commit
b885aa77a9
4 changed files with 15 additions and 2 deletions
|
|
@ -18,6 +18,16 @@ describe('install', () => {
|
|||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest v1 version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', '~> v1');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest v1 version of GoReleaser Pro', async () => {
|
||||
const bin = await goreleaser.install('goreleaser-pro', '~> v1');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest version of GoReleaser Pro', async () => {
|
||||
const bin = await goreleaser.install('goreleaser-pro', 'latest');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
|
|
|
|||
2
dist/index.js
generated
vendored
2
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -9,6 +9,9 @@ export interface GitHubRelease {
|
|||
|
||||
export const getRelease = async (distribution: string, version: string): Promise<GitHubRelease> => {
|
||||
if (version === 'latest') {
|
||||
core.warning(
|
||||
"You are using 'latest' as default version. This might include breaking changes. It is recommended to use a SemVer to lock to a major version (e.g. ~> v1)."
|
||||
);
|
||||
return getLatestRelease(distribution);
|
||||
}
|
||||
return getReleaseTag(distribution, version);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue