github-actions-templates
github-actions-templates copied to clipboard
Some workflow fails when usernames or repository names contain uppercase letters
I have encountered an issue where GitHub usernames or repository names containing uppercase letters cause regular workflows-especially those involving publishing to GitHub container services-to fail. This is problematic, as GitHub allows uppercase characters in usernames and repository names, but some container registries or deployment scripts expect only lowercase values.
Shouldn't the workflow automatically normalize or correct the casing when uppercase letters are detected in the username or repository name, instead of failing? This would make the publishing process more robust and user-friendly.
Steps to reproduce:
- Create a repository or user with uppercase letters.
- Attempt to publish a container image using a standard GitHub Actions workflow.
- Observe that the process fails due to casing issues.
Expected behavior:
The workflow should handle uppercase letters gracefully, either by converting them to lowercase or by providing a clear error message with guidance.
Can you give a reproducible example that fails due to uppercase?
I think you're referring to the env var that GHA makes usable in your workflows, like github.repository. Those vars will output exactly how the value was created, so in cases of repos, orgs, git ref's, they can be mixed case, yes. What you do with those vars is where the problem may arise, and I don't see it as GitHub's problem to fix that.
Example: The Docker CLI will not auto-lowercase a tag and will fail if you try to build an image with a uppercase tag: failed to build: invalid tag "ghcr.io/BretFisher/github-actions-templates": repository name must be lowercase
I should note that some Actions, like Docker's Build and Push action, sets org/repo lowercase automatically. That action (and the more-automated Bake action) are the only ways I push images, so I don't have this issue myself or in this repo's examples AFAIK.