1
0
Fork 0
mirror of https://github.com/actions/toolkit.git synced 2025-06-09 09:35:06 +09:00

PR feedback. Juse more JS idiomatic code

This commit is contained in:
Fredrik Skogman 2024-05-20 07:52:36 +02:00
parent e60694077d
commit 7d18e7aa0d
No known key found for this signature in database

View file

@ -42,15 +42,14 @@ export const signingEndpoints = (sigstore?: SigstoreInstance): Endpoints => {
}
function buildGitHubEndpoints(): Endpoints {
const serverURL = process.env.GITHUB_SERVER_URL ?? `https://github.com`
let url = serverURL.replace('https://', '')
const serverURL = process.env.GITHUB_SERVER_URL || 'https://github.com'
let host = new URL(serverURL).hostname
if (url === 'github.com') {
url = 'githubapp.com'
if (host === 'github.com') {
host = 'githubapp.com'
}
const endpoints: Endpoints = {
fulcioURL: `https://fulcio.${url}`,
tsaServerURL: `https://timestamp.${url}`
return {
fulcioURL: `https://fulcio.${hostl}`,
tsaServerURL: `https://timestamp.${host}`
}
return endpoints
}