Skip to content

Commit 75dbde9

Browse files
authored
Merge branch 'master' into deploy-cue
2 parents f38d465 + 42bc1bd commit 75dbde9

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

actions/install/action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Install
22
description: Installs the Catalyst-CI CLI
33
inputs:
4+
asset:
5+
description: Which asset to install from the Catalyst-CI repository
6+
required: false
7+
default: cli
48
token:
59
description: Github token used to query API for available CLI releases
610
required: false

actions/install/dist/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -13719,7 +13719,6 @@ var github = __nccwpck_require__(5438);
1371913719

1372013720

1372113721

13722-
const assetName = 'cli-linux-amd64.tar.gz';
1372313722
const repoOwner = 'input-output-hk';
1372413723
const repoName = 'catalyst-ci';
1372513724
async function run(platform = process.platform) {
@@ -13728,8 +13727,10 @@ async function run(platform = process.platform) {
1372813727
return;
1372913728
}
1373013729
try {
13730+
const assetName = core.getInput('asset');
1373113731
const token = core.getInput('token');
1373213732
const version = core.getInput('version');
13733+
const assetFullName = `${assetName}-linux-amd64.tar.gz`;
1373313734
if (version !== 'latest' && !isSemVer(version)) {
1373413735
core.setFailed('Invalid version');
1373513736
return;
@@ -13750,7 +13751,7 @@ async function run(platform = process.platform) {
1375013751
core.setFailed(`Version ${version} not found`);
1375113752
return;
1375213753
}
13753-
const asset = targetRelease.assets.find(a => a.name === assetName);
13754+
const asset = targetRelease.assets.find(a => a.name === assetFullName);
1375413755
if (!asset) {
1375513756
core.setFailed(`Asset for version v${version} not found`);
1375613757
return;

actions/install/src/install.test.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ describe('Setup Action', () => {
5151
beforeAll(() => {
5252
getInputMock.mockImplementation((name: string) => {
5353
switch (name) {
54+
case 'asset':
55+
return 'cli'
5456
case 'token':
5557
return token
5658
case 'version':
@@ -71,6 +73,8 @@ describe('Setup Action', () => {
7173
beforeAll(() => {
7274
getInputMock.mockImplementation((name: string) => {
7375
switch (name) {
76+
case 'asset':
77+
return 'cli'
7478
case 'token':
7579
return token
7680
case 'version':
@@ -103,7 +107,7 @@ describe('Setup Action', () => {
103107
})
104108

105109
describe('when the version exists', () => {
106-
describe('when the assets is not found', () => {
110+
describe('when the asset is not found', () => {
107111
beforeAll(() => {
108112
getOctokitMock.mockReturnValue({
109113
rest: {
@@ -199,6 +203,8 @@ describe('Setup Action', () => {
199203
beforeAll(() => {
200204
getInputMock.mockImplementation((name: string) => {
201205
switch (name) {
206+
case 'asset':
207+
return 'cli'
202208
case 'token':
203209
return token
204210
case 'version':

actions/install/src/install.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as core from '@actions/core'
22
import * as tc from '@actions/tool-cache'
33
import * as github from '@actions/github'
44

5-
const assetName = 'cli-linux-amd64.tar.gz'
65
const repoOwner = 'input-output-hk'
76
const repoName = 'catalyst-ci'
87

@@ -15,9 +14,12 @@ export async function run(
1514
}
1615

1716
try {
17+
const assetName = core.getInput('asset')
1818
const token = core.getInput('token')
1919
const version = core.getInput('version')
2020

21+
const assetFullName = `${assetName}-linux-amd64.tar.gz`
22+
2123
if (version !== 'latest' && !isSemVer(version)) {
2224
core.setFailed('Invalid version')
2325
return
@@ -41,7 +43,7 @@ export async function run(
4143
return
4244
}
4345

44-
const asset = targetRelease.assets.find(a => a.name === assetName)
46+
const asset = targetRelease.assets.find(a => a.name === assetFullName)
4547
if (!asset) {
4648
core.setFailed(`Asset for version v${version} not found`)
4749
return

0 commit comments

Comments
 (0)