Skip to content

Commit fc22ae5

Browse files
committed
Use temporary file to pass digest
1 parent 14c9556 commit fc22ae5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
id: docker_build
3636
run: |
3737
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
38-
DIGEST=$(python release_tools/publish_docker.py release.txt main.py ${{ env.REGISTRY }}/${{ env.USER }}/${{ env.IMAGE_NAME }} ${{ github.event.inputs.release_tag }} | grep '^Image digest: ' | cut -d':' -f2 | xargs)
38+
python release_tools/publish_docker.py release.txt main.py ${{ env.REGISTRY }}/${{ env.USER }}/${{ env.IMAGE_NAME }} ${{ github.event.inputs.release_tag }}
39+
DIGEST=$(cat /tmp/digest.txt)
3940
echo "digest=$DIGEST" >> $GITHUB_OUTPUT
4041
4142
- name: Generate artifact attestation

release_tools/publish_docker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ def build_and_push_image(dest_dir, image_name, tag):
103103
], check=True)
104104
print(f"Pushed {image_name}:{tag}")
105105
digest = get_image_digest(image_name, tag)
106-
print(f"Image digest: {digest}") # The prefix "Image digest: " is used for grepping in the release workflow
106+
print(f"Image digest: {digest}")
107+
with open("/tmp/digest.txt", "w") as f:
108+
f.write(digest)
107109

108110
if __name__ == "__main__":
109111
if len(sys.argv) != 5:

0 commit comments

Comments
 (0)