ci: fix failing release attestation (#11107) * ci: fix failing release attestation * fix --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens L. <jens@goauthentik.io>
This commit is contained in:
![98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
GitHub

parent
091e4d3e4c
commit
8326e1490c
@ -29,9 +29,9 @@ outputs:
|
|||||||
imageTags:
|
imageTags:
|
||||||
description: "Docker image tags"
|
description: "Docker image tags"
|
||||||
value: ${{ steps.ev.outputs.imageTags }}
|
value: ${{ steps.ev.outputs.imageTags }}
|
||||||
imageNames:
|
attestImageNames:
|
||||||
description: "Docker image names"
|
description: "Docker image names used for attestation"
|
||||||
value: ${{ steps.ev.outputs.imageNames }}
|
value: ${{ steps.ev.outputs.attestImageNames }}
|
||||||
imageMainTag:
|
imageMainTag:
|
||||||
description: "Docker image main tag"
|
description: "Docker image main tag"
|
||||||
value: ${{ steps.ev.outputs.imageMainTag }}
|
value: ${{ steps.ev.outputs.imageMainTag }}
|
||||||
|
@ -51,15 +51,24 @@ else:
|
|||||||
]
|
]
|
||||||
|
|
||||||
image_main_tag = image_tags[0].split(":")[-1]
|
image_main_tag = image_tags[0].split(":")[-1]
|
||||||
image_tags_rendered = ",".join(image_tags)
|
|
||||||
image_names_rendered = ",".join(set(name.split(":")[0] for name in image_tags))
|
|
||||||
|
def get_attest_image_names(image_with_tags: list[str]):
|
||||||
|
"""Attestation only for GHCR"""
|
||||||
|
image_tags = []
|
||||||
|
for image_name in set(name.split(":")[0] for name in image_with_tags):
|
||||||
|
if not image_name.startswith("ghcr.io"):
|
||||||
|
continue
|
||||||
|
image_tags.append(image_name)
|
||||||
|
return ",".join(set(image_tags))
|
||||||
|
|
||||||
|
|
||||||
with open(os.environ["GITHUB_OUTPUT"], "a+", encoding="utf-8") as _output:
|
with open(os.environ["GITHUB_OUTPUT"], "a+", encoding="utf-8") as _output:
|
||||||
print(f"shouldBuild={should_build}", file=_output)
|
print(f"shouldBuild={should_build}", file=_output)
|
||||||
print(f"sha={sha}", file=_output)
|
print(f"sha={sha}", file=_output)
|
||||||
print(f"version={version}", file=_output)
|
print(f"version={version}", file=_output)
|
||||||
print(f"prerelease={prerelease}", file=_output)
|
print(f"prerelease={prerelease}", file=_output)
|
||||||
print(f"imageTags={image_tags_rendered}", file=_output)
|
print(f"imageTags={','.join(image_tags)}", file=_output)
|
||||||
print(f"imageNames={image_names_rendered}", file=_output)
|
print(f"attestImageNames={get_attest_image_names(image_tags)}", file=_output)
|
||||||
print(f"imageMainTag={image_main_tag}", file=_output)
|
print(f"imageMainTag={image_main_tag}", file=_output)
|
||||||
print(f"imageMainName={image_tags[0]}", file=_output)
|
print(f"imageMainName={image_tags[0]}", file=_output)
|
||||||
|
2
.github/workflows/ci-main.yml
vendored
2
.github/workflows/ci-main.yml
vendored
@ -261,7 +261,7 @@ jobs:
|
|||||||
id: attest
|
id: attest
|
||||||
if: ${{ steps.ev.outputs.shouldBuild == 'true' }}
|
if: ${{ steps.ev.outputs.shouldBuild == 'true' }}
|
||||||
with:
|
with:
|
||||||
subject-name: ${{ steps.ev.outputs.imageNames }}
|
subject-name: ${{ steps.ev.outputs.attestImageNames }}
|
||||||
subject-digest: ${{ steps.push.outputs.digest }}
|
subject-digest: ${{ steps.push.outputs.digest }}
|
||||||
push-to-registry: true
|
push-to-registry: true
|
||||||
pr-comment:
|
pr-comment:
|
||||||
|
2
.github/workflows/ci-outpost.yml
vendored
2
.github/workflows/ci-outpost.yml
vendored
@ -115,7 +115,7 @@ jobs:
|
|||||||
id: attest
|
id: attest
|
||||||
if: ${{ steps.ev.outputs.shouldBuild == 'true' }}
|
if: ${{ steps.ev.outputs.shouldBuild == 'true' }}
|
||||||
with:
|
with:
|
||||||
subject-name: ${{ steps.ev.outputs.imageNames }}
|
subject-name: ${{ steps.ev.outputs.attestImageNames }}
|
||||||
subject-digest: ${{ steps.push.outputs.digest }}
|
subject-digest: ${{ steps.push.outputs.digest }}
|
||||||
push-to-registry: true
|
push-to-registry: true
|
||||||
build-binary:
|
build-binary:
|
||||||
|
4
.github/workflows/release-publish.yml
vendored
4
.github/workflows/release-publish.yml
vendored
@ -58,7 +58,7 @@ jobs:
|
|||||||
- uses: actions/attest-build-provenance@v1
|
- uses: actions/attest-build-provenance@v1
|
||||||
id: attest
|
id: attest
|
||||||
with:
|
with:
|
||||||
subject-name: ${{ steps.ev.outputs.imageNames }}
|
subject-name: ${{ steps.ev.outputs.attestImageNames }}
|
||||||
subject-digest: ${{ steps.push.outputs.digest }}
|
subject-digest: ${{ steps.push.outputs.digest }}
|
||||||
push-to-registry: true
|
push-to-registry: true
|
||||||
build-outpost:
|
build-outpost:
|
||||||
@ -122,7 +122,7 @@ jobs:
|
|||||||
- uses: actions/attest-build-provenance@v1
|
- uses: actions/attest-build-provenance@v1
|
||||||
id: attest
|
id: attest
|
||||||
with:
|
with:
|
||||||
subject-name: ${{ steps.ev.outputs.imageNames }}
|
subject-name: ${{ steps.ev.outputs.attestImageNames }}
|
||||||
subject-digest: ${{ steps.push.outputs.digest }}
|
subject-digest: ${{ steps.push.outputs.digest }}
|
||||||
push-to-registry: true
|
push-to-registry: true
|
||||||
build-outpost-binary:
|
build-outpost-binary:
|
||||||
|
Reference in New Issue
Block a user