testdrivenio/django-github-digitalocean

CI Does Not Build with Uppercase Chars in $GITHUB_REPOSITORY variable

WayneLambert opened this issue · 2 comments

For anyone that has either a username or a repository name in GitHub that contains capital letters, the build job will fail. For example, my username is WayneLambert, therefore my build process failed with the following in the traceback:

Run docker-compose -f docker-compose.ci.yml build
  docker-compose -f docker-compose.ci.yml build
  shell: /bin/bash -e {0}
  env:
    WEB_IMAGE: docker.pkg.github.com/WayneLambert/django-github-digitalocean/web
    NGINX_IMAGE: docker.pkg.github.com/WayneLambert/django-github-digitalocean/nginx
Building web
invalid reference format: repository name must be lowercase
##[error]Process completed with exit code 1.

Full image below:

ci-failure

By the look of things, the variable takes the repository name as a concatenation of the username and the repository name exactly as it is.

I circumvented the unnecessary variable by just hardcoding the actual url. In my case, my github username is pattoM and the capitalized m was bringing on issues.

Yes, you can hard code the value and it will then build but if your goal is to build a template for future projects, then you can replace $GITHUB_REPOSITORY with $(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]') and it will build.