Skip to content

Commit a36862c

Browse files
committed
fix: auto-detect sigstore instance from repo visibility
Public repos use 'public-good' (Sigstore public CA), private repos use 'github' (GitHub internal Fulcio). Matches actions/attest@v4 default behavior via GITHUB_REPOSITORY_VISIBILITY env var.
1 parent 5e76e88 commit a36862c

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

dist/index.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/release.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ import { attestProvenance } from '@actions/attest'
77
import { readManifest } from './detect.js'
88
import type { ProjectType, ValidationResult } from './types.js'
99

10+
type SigstoreInstance = 'public-good' | 'github'
11+
12+
function getSigstoreInstance(): SigstoreInstance {
13+
const repoVisibility = process.env.GITHUB_REPOSITORY_VISIBILITY ?? ''
14+
return repoVisibility === 'public' ? 'public-good' : 'github'
15+
}
16+
1017
function getTagFromRef(): string | null {
1118
const ref = process.env.GITHUB_REF ?? ''
1219
if (ref.startsWith('refs/tags/')) return ref.replace('refs/tags/', '')
@@ -155,7 +162,7 @@ export async function attestBuildArtifacts(
155162
subjectName: subject.name,
156163
subjectDigest: { sha256: digest },
157164
token,
158-
sigstore: 'public-good'
165+
sigstore: getSigstoreInstance()
159166
})
160167

161168
core.info(

0 commit comments

Comments
 (0)