Compare commits

...

1 Commits

Author SHA1 Message Date
Cursor Agent
dc84694353
ci: skip image attestation on user-owned private repos
GitHub artifact attestations are unavailable for private repositories
under personal accounts. The publish job already tags images successfully;
only the attest step failed. Gate attestation on visibility and owner type
so org and public repositories still attest.

Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
2026-10-03 11:25:10 +00:00
2 changed files with 5 additions and 0 deletions

View File

@ -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 }}

View File

@ -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", () => {