Skip to content

Commit 6940bfb

Browse files
committed
fix: get digest of image
1 parent 67c0dab commit 6940bfb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/build_agent_container.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
uses: docker/setup-buildx-action@v3
5050

5151
- name: Build the agent container image
52+
id: build
5253
run: |
5354
apt-get update && apt-get install -y make git
5455
cd agent
@@ -57,6 +58,7 @@ jobs:
5758
# Get the last tag and use it as the env var AGENT_VERSION if it doesn't exist use 0.0.0+{github.sha}
5859
export AGENT_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0+${{ github.sha }}")
5960
make docker-build-only agent_version=${AGENT_VERSION}
61+
echo "digest=$(docker inspect --format='{{index .RepoDigests 0}}' ${REGISTRY}}/${{env.IMAGE_NAME}}/agent:${{ github.sha }} | cut -d: -f2)" >> $GITHUB_OUTPUT
6062
env:
6163
AGENT_IMAGE: ${{env.IMAGE_NAME}}/agent
6264

@@ -65,6 +67,6 @@ jobs:
6567
uses: actions/attest-build-provenance@v2
6668
with:
6769
subject-name: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}/agent
68-
subject-digest: ${{ steps.push.outputs.digest }}
70+
subject-digest: ${{ steps.build.outputs.digest }}
6971
push-to-registry: true
7072

0 commit comments

Comments
 (0)