Skip to content

Commit

Permalink
PR feedback. Juse more JS idiomatic code
Browse files Browse the repository at this point in the history
  • Loading branch information
kommendorkapten committed May 20, 2024
1 parent e606940 commit 7d18e7a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/attest/src/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 7d18e7a

Please sign in to comment.