Skip to content

Commit

Permalink
Fixes publishing to github container registry (INTO-CPS-Association#987)
Browse files Browse the repository at this point in the history
The github container registry expects organization scope to be
lowercase. This PR converts org scope to lowercase even if it is
uppercase.
  • Loading branch information
aryanpingle authored Oct 22, 2024
1 parent 54f6dbe commit 037b10e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/docker-ghcr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reusable workflow for building and pushing a Docker Image to GHCR.
#
# Username is taken from the user who scheduled the workflow
# Username is the repository owner converted to lowercase
# Password is taken from the auto-generated GitHub token

name: Build and Push Docker Image (GHCR)
Expand All @@ -21,7 +21,6 @@ on:

env:
registry: ghcr.io
ghcr-scope: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

jobs:
Expand All @@ -36,6 +35,14 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

# Sets a new environment variable that can be accessed in later
# steps via ${{ env.ghcr-scope }}
- name: Get repository owner in lower-case
run: |
echo "ghcr-scope=${REPOSITORY_OWNER,,}" >> $GITHUB_ENV
env:
REPOSITORY_OWNER: ${{ github.repository_owner }}

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand Down

0 comments on commit 037b10e

Please sign in to comment.