Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-41568: Expose the built image ID as an output #6

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ To automatically set that, the above example uses the context variable `${{ gith

### Outputs

- `fully_qualified_image_digest` (string) A complete, unique, and immutable identifier for the built image,
e.g. `ghcr.io/owner/repo@sha256:4dcaf15076e027f272dc8aba14b1bab77fec44f8aac94c94f1b01ceee8d099d4`.
This string may be used to reference the built image in `docker pull`, `docker run`, etc.
- `tag` (string) the tag of the image that was pushed to ghcr.io.

## Developer guide
Expand Down
4 changes: 4 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ outputs:
tag:
description: "The tag of the Docker image that was built."
value: ${{ steps.tag.outputs.tag }}
fully_qualified_image_digest:
description: "A complete, unique, immutable identifier for the built image, including the registry and digest"
value: "ghcr.io/${{ inputs.image }}@${{ steps.build.outputs.digest }}"

runs:
using: "composite"
Expand All @@ -47,6 +50,7 @@ runs:
password: ${{ inputs.github_token }}

- name: Build and push
id: build
uses: docker/build-push-action@v4
with:
context: "${{ inputs.context }}"
Expand Down