Lowercase env.IMAGE_REGISTRY

Workaround for a bug in push-to-ghcr that makes it impossible to push your image if your GitHub username contains capital letters.
This commit is contained in:
Kyle Gospodnetich
2022-12-12 10:14:19 -08:00
committed by GitHub
parent bfec36e6f7
commit beb8d1bf86

View File

@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
steps:
# Checkout push-to-registry action github repository
- name: Checkout Push to Registry action
uses: actions/checkout@v2
@@ -32,6 +32,14 @@ jobs:
tags: ${{ env.IMAGE_TAGS }}
oci: true
# Workaround bug where capital letters in your GitHub user name make it impossible to push to GHCR.
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v5
with:
string: ${{ env.IMAGE_REGISTRY }}
# Push the image to GHCR (Image Registry)
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
@@ -39,7 +47,7 @@ jobs:
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
registry: ${{ steps.registry_case.outputs.lowercase }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
extra-args: |