diff --git a/.github/workflows/publish-server-image.yml b/.github/workflows/publish-server-image.yml index 22dd357..dedea74 100644 --- a/.github/workflows/publish-server-image.yml +++ b/.github/workflows/publish-server-image.yml @@ -256,7 +256,9 @@ jobs: grep -Fqx "$want" <<< "$platforms" || { echo "$first_tag is missing $want" >&2; exit 1; } done echo "digest=$(docker buildx imagetools inspect "$first_tag" --format '{{.Manifest.Digest}}')" >> "$GITHUB_OUTPUT" + # GitHub artifact attestations are unavailable for private repos on personal accounts. - name: Attest the published image + if: github.event.repository.private != true || github.repository_owner_type != 'User' uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 with: subject-name: ghcr.io/${{ steps.ns.outputs.repo }}/${{ matrix.name }} diff --git a/infra/updater/src/publish-workflow.test.ts b/infra/updater/src/publish-workflow.test.ts index bf1faef..f75de81 100644 --- a/infra/updater/src/publish-workflow.test.ts +++ b/infra/updater/src/publish-workflow.test.ts @@ -41,6 +41,9 @@ describe("server image publish workflow", () => { expect(workflowText).toContain('if [[ "${#sources[@]}" -ne 1 ]]'); expect(workflowText).toContain("for want in linux/amd64; do"); expect(workflowText).toContain("actions/attest-build-provenance@"); + expect(workflowText).toContain( + "if: github.event.repository.private != true || github.repository_owner_type != 'User'", + ); }); it("stores digest markers under RUNNER_TEMP so self-hosted runners do not leak stale files", () => {