Skip to content

Commit f1185f1

Browse files
authored
bump @actions/attest from 1.4.1 to 1.4.2 (#225)
Signed-off-by: Brian DeHamer <[email protected]>
1 parent d438876 commit f1185f1

File tree

4 files changed

+19
-55
lines changed

4 files changed

+19
-55
lines changed

dist/index.js

+10-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "actions/attest-build-provenance",
33
"description": "Generate signed build provenance attestations",
4-
"version": "1.1.2",
4+
"version": "1.1.3",
55
"author": "",
66
"private": true,
77
"homepage": "https://github.com/actions/attest-build-provenance",
@@ -70,7 +70,7 @@
7070
]
7171
},
7272
"dependencies": {
73-
"@actions/attest": "^1.4.1",
73+
"@actions/attest": "^1.4.2",
7474
"@actions/core": "^1.10.1"
7575
},
7676
"devDependencies": {

src/main.ts

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
import { buildSLSAProvenancePredicate } from '@actions/attest'
22
import * as core from '@actions/core'
33

4-
const VALID_SERVER_URLS = [
5-
'https://github.com',
6-
new RegExp('^https://[a-z0-9-]+\\.ghe\\.com$')
7-
] as const
8-
94
/**
105
* The main function for the action.
116
* @returns {Promise<void>} Resolves when the action is complete.
127
*/
138
export async function run(): Promise<void> {
149
try {
15-
const issuer = getIssuer()
16-
1710
// Calculate subject from inputs and generate provenance
18-
const predicate = await buildSLSAProvenancePredicate(issuer)
11+
const predicate = await buildSLSAProvenancePredicate()
1912

2013
core.setOutput('predicate', predicate.params)
2114
core.setOutput('predicate-type', predicate.type)
@@ -25,21 +18,3 @@ export async function run(): Promise<void> {
2518
core.setFailed(error.message)
2619
}
2720
}
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

Comments
 (0)