1
1
import { buildSLSAProvenancePredicate } from '@actions/attest'
2
2
import * as core from '@actions/core'
3
3
4
- const VALID_SERVER_URLS = [
5
- 'https://github.com' ,
6
- new RegExp ( '^https://[a-z0-9-]+\\.ghe\\.com$' )
7
- ] as const
8
-
9
4
/**
10
5
* The main function for the action.
11
6
* @returns {Promise<void> } Resolves when the action is complete.
12
7
*/
13
8
export async function run ( ) : Promise < void > {
14
9
try {
15
- const issuer = getIssuer ( )
16
-
17
10
// Calculate subject from inputs and generate provenance
18
- const predicate = await buildSLSAProvenancePredicate ( issuer )
11
+ const predicate = await buildSLSAProvenancePredicate ( )
19
12
20
13
core . setOutput ( 'predicate' , predicate . params )
21
14
core . setOutput ( 'predicate-type' , predicate . type )
@@ -25,21 +18,3 @@ export async function run(): Promise<void> {
25
18
core . setFailed ( error . message )
26
19
}
27
20
}
28
-
29
- // Derive the current OIDC issuer based on the server URL
30
- function getIssuer ( ) : string {
31
- const serverURL = process . env . GITHUB_SERVER_URL || 'https://github.com'
32
-
33
- // Ensure the server URL is a valid GitHub server URL
34
- if ( ! VALID_SERVER_URLS . some ( valid_url => serverURL . match ( valid_url ) ) ) {
35
- throw new Error ( `Invalid server URL: ${ serverURL } ` )
36
- }
37
-
38
- let host = new URL ( serverURL ) . hostname
39
-
40
- if ( host === 'github.com' ) {
41
- host = 'githubusercontent.com'
42
- }
43
-
44
- return `https://token.actions.${ host } `
45
- }
0 commit comments