Repository navigation
fix(ci): lowercase GHCR owner in Trivy image ref - #13
Merged
Merged
Conversation
github.repository_owner preserves case (KingPin), but GHCR requires
lowercase. Use ${GITHUB_REPOSITORY_OWNER,,} bash expansion to set
OWNER_LC env var safely, then reference it in the image-ref.
There was a problem hiding this comment.
Pull request overview
Updates the Trivy Security Scan workflow to avoid GHCR image reference parsing failures caused by mixed-case github.repository_owner, by introducing a lowercased owner environment variable for the image reference.
Changes:
- Add a workflow step that writes a lowercased
OWNER_LCvalue to$GITHUB_ENV. - Update Trivy
image-refto use${{ env.OWNER_LC }}when referencing the GHCR image.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set lowercase owner |
There was a problem hiding this comment.
This step relies on Bash-specific parameter expansion (${VAR,,}), which will fail if the default shell is changed (e.g., to sh) or if this workflow is later run on a non-Linux runner. To make the dependency explicit and future-proof, set shell: bash for this step (or replace with a POSIX-compatible lowercasing approach).
Suggested change
| - name: Set lowercase owner | |
| - name: Set lowercase owner | |
| shell: bash |
KingPin
added a commit
that referenced
this pull request
May 4, 2026
github.repository_owner preserves case (KingPin), but GHCR requires
lowercase. Use ${GITHUB_REPOSITORY_OWNER,,} bash expansion to set
OWNER_LC env var safely, then reference it in the image-ref.
Co-authored-by: kingpin <kingpin@localhost>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
github.repository_ownerpreserves casing (KingPin), but GHCR requires a fully lowercase reference — hence thecould not parse referencefatal errorGITHUB_REPOSITORY_OWNERvia bash${var,,}expansion intoOWNER_LCenv var (safe — uses the env var directly, no expression interpolation inrun)${{ env.OWNER_LC }}in the Trivyimage-refTest plan
could not parse referencefatal error