Skip to content

Commit

Permalink
fix: fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
asjdf committed Jul 22, 2024
1 parent 4c01895 commit b70ec41
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ jobs:
go-url: 'https://github.com/actions/go-versions/releases/download/1.22.5-9771837482/go-1.22.5-linux-x64.tar.gz'
go-version: 1.22.5
cache-sdk: false
go-url-type: 'manifest'

- name: verify go
run: __tests__/verify-go.sh "1.22.5"
Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ author: 'GitHub'
inputs:
go-url:
description: 'Download Go from url. Will ignore go-version and go-version-file.'
go-url-type:
description: 'dist or manifest'
go-version:
description: 'The Go version to download (if necessary) and use. Supports semver spec and ranges. Be sure to enclose this option in single quotation marks.'
go-version-file:
Expand Down
5 changes: 4 additions & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88298,8 +88298,11 @@ function getGo(goUrl_1, versionSpec_1, checkLatest_1, auth_1) {
let info = null;
if (!downloadPath && goUrl) {
try {
const type = ['dist', 'manifest'].includes(core.getInput('go-url-type'))
? core.getInput('go-url-type')
: 'dist';
downloadPath = yield installGoVersion({
type: 'dist',
type: type,
downloadUrl: goUrl,
resolvedVersion: versionSpec,
fileName: ((_a = goUrl.match(/\/([^\/?#]+)(?:[?#]|$)/i)) === null || _a === void 0 ? void 0 : _a[1]) || ''
Expand Down
7 changes: 6 additions & 1 deletion src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,14 @@ export async function getGo(

if (!downloadPath && goUrl) {
try {
const type: InstallationType = ['dist', 'manifest'].includes(
core.getInput('go-url-type')
)
? (core.getInput('go-url-type') as InstallationType)
: 'dist';
downloadPath = await installGoVersion(
{
type: 'dist',
type: type,
downloadUrl: goUrl,
resolvedVersion: versionSpec,
fileName: goUrl.match(/\/([^\/?#]+)(?:[?#]|$)/i)?.[1] || ''

Check failure on line 113 in src/installer.ts

View workflow job for this annotation

GitHub Actions / Basic validation / build (ubuntu-latest)

Unnecessary escape character: \/

Check failure on line 113 in src/installer.ts

View workflow job for this annotation

GitHub Actions / Basic validation / build (windows-latest)

Unnecessary escape character: \/

Check failure on line 113 in src/installer.ts

View workflow job for this annotation

GitHub Actions / Basic validation / build (macos-latest)

Unnecessary escape character: \/
Expand Down

0 comments on commit b70ec41

Please sign in to comment.