mirror of https://github.com/actions/toolkit
PR feedback. Juse more JS idiomatic code
parent
e60694077d
commit
7d18e7aa0d
|
@ -42,15 +42,14 @@ export const signingEndpoints = (sigstore?: SigstoreInstance): Endpoints => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildGitHubEndpoints(): Endpoints {
|
function buildGitHubEndpoints(): Endpoints {
|
||||||
const serverURL = process.env.GITHUB_SERVER_URL ?? `https://github.com`
|
const serverURL = process.env.GITHUB_SERVER_URL || 'https://github.com'
|
||||||
let url = serverURL.replace('https://', '')
|
let host = new URL(serverURL).hostname
|
||||||
|
|
||||||
if (url === 'github.com') {
|
if (host === 'github.com') {
|
||||||
url = 'githubapp.com'
|
host = 'githubapp.com'
|
||||||
}
|
}
|
||||||
const endpoints: Endpoints = {
|
return {
|
||||||
fulcioURL: `https://fulcio.${url}`,
|
fulcioURL: `https://fulcio.${hostl}`,
|
||||||
tsaServerURL: `https://timestamp.${url}`
|
tsaServerURL: `https://timestamp.${host}`
|
||||||
}
|
}
|
||||||
return endpoints
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue