Github Actions: Repository name must be lowercase

My username contains uppercase letters and this hinders my ability to push to ghcr.io. Are there any workarounds for this? I just want to push to the registry and see it on my GitHub Repository.

error: invalid tag "ghcr.io/DenizUgur/safari:b110b2ab2ad69f9fe64380feda88a7e00a12e88b": repository name must be lowercase

workflow file

Image names must be lower case, try using the lower case version of your username. You can create an environment variable with the lower case version, so you don’t have to hardcode it. Looking at your workflow I guess github.repository_owner is the issue, so you could do this:

- name: set lower case owner name
  run: |
    echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
  env:
    OWNER: '${{ github.repository_owner }}'

And then use the OWNER_LC environment variable instead of github.repository_owner.

1 Like

Will use, thank you. I thought GitHub usernames were case-sensitive.

I think GitHub is case-preserving as opposed to case-sensitive.
You could technically try to rename your username (probably to a placeholder and then to the lowercase form).

I’m not sure I’d bother.

It’s a general Docker limitation, not specific to GHCR.

If you use our docker-publish default workflow you’ll get a lot of this for free. The metadata action manages the lowercasing of names and extracts the right extra data for you.