wash
wash copied to clipboard
[FEATURE] Add annotations as optional parameters to oci push
Add annotations as optional parameters to oci push.
wkg oci push -h
...
-a, --author <AUTHOR> An optional author to set for the pushed component
--annotation <ANNOTATION> Add an OCI annotation to the image manifest
Additionally, we could simplify this for end-users by also supporting parameters that align with opencontainers annotations, e.g. --description translates to --annotation "org.opencontainers.image.description"="${{ inputs.description }}".
output=$(wash oci push ${{ inputs.oci-reference-without-tag }}:${{ inputs.version }} ${{ inputs.file }}\
--annotation "org.opencontainers.image.description"="${{ inputs.description }}" \
--annotation "org.opencontainers.image.source"="${{ inputs.source }}" \
--annotation "org.opencontainers.image.url"="${{ inputs.homepage }}" \
--annotation "org.opencontainers.image.version"="${{ inputs.version }}" \
--annotation "org.opencontainers.image.licenses"="${{ inputs.licenses }}")
digest=$(echo "$output" | grep -oP 'digest: \K.*')