Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jumoog committed Sep 30, 2024
1 parent 24fba2e commit 58d7c71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/validate-and-update-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { URL } from 'url'
const repository = process.env.GITHUB_REPOSITORY
const version = process.env.NEW_FILE_VERSION
const gitHubRepoVisibilty = process.env.GITHUB_REPO_VISIBILITY
let currentVersion: string | undefined
let currentVersion: string
let targetAbi = ''

type Manifest = {
Expand Down Expand Up @@ -286,13 +286,14 @@ export function filterVersions(
const latestVersion = matchingVersions[matchingVersions.length - 1]
return latestVersion
}
core.setFailed(`No versions match the pattern ${versionPattern}`)
return undefined
}

async function getNugetPackageVersion(
packageName: string,
versionPattern: string
): Promise<string | undefined> {
): Promise<string> {
try {
const versions = await fetchNugetPackageVersions(packageName)
const latestVersion = filterVersions(versions, versionPattern)
Expand All @@ -310,5 +311,6 @@ async function getNugetPackageVersion(
} catch (error) {
core.setFailed(String(error))
}
return undefined
core.setFailed(`Something went wrong while fetching ${packageName}`)
return ''
}

0 comments on commit 58d7c71

Please sign in to comment.