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

downcase subject name for OCI images #63

Merged
merged 2 commits into from
May 14, 2024
Merged

downcase subject name for OCI images #63

merged 2 commits into from
May 14, 2024

Conversation

bdehamer
Copy link
Collaborator

Automatically downcases the subject name when the push-to-registry flag is supplied. The OCI spec requires that the image repository name be all lower-case, so any time a user is pushing an attestation to a registry the subject name MUST conform to the OCI spec.

This is mainly a problem when the GitHub repository name is used as the repository name with something like this:

- name: Attest Build Provenance
  uses: actions/attest-build-provenance@v1
  with:
    subject-name: ghcr.io/${{ github.repository }}
    subject-digest: ${{ steps.build-and-push.outputs.digest }}
    push-to-registry: true

If the GH repository name happens to contain uppercase characters this will fail.

The change made here will ensure that this use case will succeed even if the GH repo name contains uppercase characters.

It's worth noting that the docker/metadata-action and docker/buid-push-action actions perform a similar transformation on the input to ensure a valid image name.

See: actions/attest-build-provenance#71

@bdehamer bdehamer requested a review from a team as a code owner May 13, 2024 17:16
Copy link

@kommendorkapten kommendorkapten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@bdehamer bdehamer merged commit 38ff958 into main May 14, 2024
15 checks passed
@bdehamer bdehamer deleted the bdehamer/downcase branch May 14, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants