mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2026-09-28 05:34:13 +00:00
fix: handle Hugo 0.139.5 archive fallback (#696)
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import getURL from '../src/get-url';
|
||||
import getURL, {getDownloadVersion} from '../src/get-url';
|
||||
|
||||
describe('getURL()', () => {
|
||||
test('get URLs to Linux assets', () => {
|
||||
@@ -139,6 +139,19 @@ describe('getURL()', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
test('get URLs to Hugo 0.139.5 archive alias', () => {
|
||||
const baseURL = 'https://github.com/gohugoio/hugo/releases/download/v0.139.4';
|
||||
expect(getDownloadVersion('0.139.5')).toBe('0.139.4');
|
||||
expect(getURL('linux', 'amd64', 'true', '0.139.5')).toEqual([
|
||||
`${baseURL}/hugo_extended_0.139.4_linux-amd64.tar.gz`,
|
||||
`${baseURL}/hugo_extended_0.139.4_Linux-amd64.tar.gz`,
|
||||
`${baseURL}/hugo_extended_0.139.4_Linux_amd64.tar.gz`,
|
||||
`${baseURL}/hugo_extended_v0.139.4_linux-amd64.tar.gz`,
|
||||
`${baseURL}/hugo_extended_v0.139.4_Linux-amd64.tar.gz`,
|
||||
`${baseURL}/hugo_extended_v0.139.4_Linux_amd64.tar.gz`
|
||||
]);
|
||||
});
|
||||
|
||||
test('get a fallback URL to an unknown OS asset', () => {
|
||||
const baseURL = 'https://github.com/gohugoio/hugo/releases/download/v0.58.2';
|
||||
expect(getURL('MyOS', '64bit', 'false', '0.58.2')).toEqual([
|
||||
|
||||
Reference in New Issue
Block a user