Remove a duplicate function
This commit is contained in:
parent
7612c7b39b
commit
2094357ae4
13
src/url.ts
13
src/url.ts
@ -57,16 +57,3 @@ export const getHkpUrl = (host: string, fp: string, port?: number) =>
|
|||||||
|
|
||||||
export const getGitHubGpgUrl = (user: string) =>
|
export const getGitHubGpgUrl = (user: string) =>
|
||||||
buildUrl("github.com", `/${user.replace(/^@/, "")}.gpg`);
|
buildUrl("github.com", `/${user.replace(/^@/, "")}.gpg`);
|
||||||
|
|
||||||
export const getGitHubManifestUrl = (
|
|
||||||
owner: string,
|
|
||||||
repo: string,
|
|
||||||
tag: string,
|
|
||||||
asset: string,
|
|
||||||
) =>
|
|
||||||
buildUrl(
|
|
||||||
"github.com",
|
|
||||||
[owner, repo, "releases", "download", tag, asset]
|
|
||||||
.map(encodeURIComponent)
|
|
||||||
.join("/"),
|
|
||||||
);
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { info, warning, setOutput } from "@actions/core";
|
|||||||
import { GITHUB_DIGEST_THRESHOLD } from "./github-api";
|
import { GITHUB_DIGEST_THRESHOLD } from "./github-api";
|
||||||
import { fetchAssetMetadata, getHexFromDigest } from "./github-asset";
|
import { fetchAssetMetadata, getHexFromDigest } from "./github-asset";
|
||||||
import { getVerifiedManifest } from "./manifest";
|
import { getVerifiedManifest } from "./manifest";
|
||||||
import { getGitHubManifestUrl } from "./url";
|
import { gitHubAssetDownloadUrl } from "./url";
|
||||||
|
|
||||||
class DigestVerificationError extends Error {}
|
class DigestVerificationError extends Error {}
|
||||||
class UnsupportedAlgorithmError extends Error {}
|
class UnsupportedAlgorithmError extends Error {}
|
||||||
@ -93,7 +93,7 @@ export async function verifyAsset(
|
|||||||
let manifestBaseUrl = "";
|
let manifestBaseUrl = "";
|
||||||
if (metadata) {
|
if (metadata) {
|
||||||
assetName = metadata.name;
|
assetName = metadata.name;
|
||||||
manifestBaseUrl = getGitHubManifestUrl(
|
manifestBaseUrl = gitHubAssetDownloadUrl(
|
||||||
metadata.owner,
|
metadata.owner,
|
||||||
metadata.repo,
|
metadata.repo,
|
||||||
metadata.tag,
|
metadata.tag,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user