You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We intend to keep our fork in sync, and automatically publish updated container images to our GHCR.
Description
Our organization username has upper case characters in it, and this causes the "Check docker image" build step to fail with the following error:
Run docker run --rm -i --user $(id -u):$(id -g) -e GH_TOKEN=${GH_TOKEN} -v ${PWD}:/docs ghcr.io/MilestoneSystemsInc/mkdocs-material-insiders:9.1.11-insiders-4.33.1 new .
docker: invalid reference format: repository name must be lowercase.
See 'docker run --help'.
Error: Process completed with exit code 125.
To resolve this for any user or organization with upper case characters in their GitHub name, I'm proposing to convert the value of github.event.repository.full_name to lower case before calling docker run when validating the docker image.
Note: This is being shared as a change request instead of a bug because the bug template requires an attached reproduction. I don't think it makes sense to follow the creating-a-reproduction guide for an issue related to GitHub Action workflow(s).
Proposed change
In the example below, the "Check Docker image" step has the following modifications:
The value of github.event.repository.full_name is stored in an environment variable named REPO_FULL_NAME.
The executions of docker run are updated to use ${REPO_FULL_NAME,,} in the image name instead of the raw value of github.event.repository.full_name.
Note: The syntax ${VAR,,} is an example of parameter expansion in bash. In this case it converts all upper case characters to lowercase. The reverse could be done with ${VAR^^}.
This change should not impact authors, users. It should only improve the CI/CD experience for anyone using GitHub Actions to publish updated container images to GHCR using the unaltered build.yml from squidfunk/mkdocs-material or squidfunk/mkdocs-material-insiders.
Context
We intend to keep our fork in sync, and automatically publish updated container images to our GHCR.
Description
Our organization username has upper case characters in it, and this causes the "Check docker image" build step to fail with the following error:
To resolve this for any user or organization with upper case characters in their GitHub name, I'm proposing to convert the value of
github.event.repository.full_name
to lower case before callingdocker run
when validating the docker image.Note: This is being shared as a change request instead of a bug because the bug template requires an attached reproduction. I don't think it makes sense to follow the creating-a-reproduction guide for an issue related to GitHub Action workflow(s).
Proposed change
In the example below, the "Check Docker image" step has the following modifications:
github.event.repository.full_name
is stored in an environment variable namedREPO_FULL_NAME
.docker run
are updated to use${REPO_FULL_NAME,,}
in the image name instead of the raw value ofgithub.event.repository.full_name
.Note: The syntax
${VAR,,}
is an example of parameter expansion in bash. In this case it converts all upper case characters to lowercase. The reverse could be done with${VAR^^}
.Related links
Use Cases
This change should not impact authors, users. It should only improve the CI/CD experience for anyone using GitHub Actions to publish updated container images to GHCR using the unaltered
build.yml
fromsquidfunk/mkdocs-material
orsquidfunk/mkdocs-material-insiders
.Visuals
No response
Before submitting
The text was updated successfully, but these errors were encountered: