From dbfb6d5993736721ae0557bab9e5a148cc4b4a13 Mon Sep 17 00:00:00 2001 From: John Karabudak Date: Sat, 15 Jun 2024 22:18:18 -0230 Subject: [PATCH 1/2] fixed GitHub actions on usernames with uppercase characters --- .github/workflows/docker-build.yaml | 56 +++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index da40f56ff..60575cebe 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -11,8 +11,6 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - FULL_IMAGE_NAME: ghcr.io/${{ github.repository }} jobs: build-main-image: @@ -28,6 +26,15 @@ jobs: - linux/arm64 steps: + # GitHub Packages requires the entire repository name to be in lowercase + # although the repository owner has a lowercase username, this prevents some people from running actions after forking + - name: Set repository and image name to lowercase + run: | + echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + env: + IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + - name: Prepare run: | platform=${{ matrix.platform }} @@ -116,6 +123,15 @@ jobs: - linux/arm64 steps: + # GitHub Packages requires the entire repository name to be in lowercase + # although the repository owner has a lowercase username, this prevents some people from running actions after forking + - name: Set repository and image name to lowercase + run: | + echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + env: + IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + - name: Prepare run: | platform=${{ matrix.platform }} @@ -207,6 +223,15 @@ jobs: - linux/arm64 steps: + # GitHub Packages requires the entire repository name to be in lowercase + # although the repository owner has a lowercase username, this prevents some people from running actions after forking + - name: Set repository and image name to lowercase + run: | + echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + env: + IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + - name: Prepare run: | platform=${{ matrix.platform }} @@ -289,6 +314,15 @@ jobs: runs-on: ubuntu-latest needs: [ build-main-image ] steps: + # GitHub Packages requires the entire repository name to be in lowercase + # although the repository owner has a lowercase username, this prevents some people from running actions after forking + - name: Set repository and image name to lowercase + run: | + echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + env: + IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + - name: Download digests uses: actions/download-artifact@v4 with: @@ -335,6 +369,15 @@ jobs: runs-on: ubuntu-latest needs: [ build-cuda-image ] steps: + # GitHub Packages requires the entire repository name to be in lowercase + # although the repository owner has a lowercase username, this prevents some people from running actions after forking + - name: Set repository and image name to lowercase + run: | + echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + env: + IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + - name: Download digests uses: actions/download-artifact@v4 with: @@ -382,6 +425,15 @@ jobs: runs-on: ubuntu-latest needs: [ build-ollama-image ] steps: + # GitHub Packages requires the entire repository name to be in lowercase + # although the repository owner has a lowercase username, this prevents some people from running actions after forking + - name: Set repository and image name to lowercase + run: | + echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + env: + IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + - name: Download digests uses: actions/download-artifact@v4 with: From 60ee08a8ac2f26a33b95f6f98dc80ca68b772e95 Mon Sep 17 00:00:00 2001 From: John Karabudak Date: Sun, 16 Jun 2024 15:27:13 -0230 Subject: [PATCH 2/2] made the environment variable name IMAGE_NAME as requested --- .github/workflows/docker-build.yaml | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 60575cebe..0e62be3d9 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -30,10 +30,10 @@ jobs: # although the repository owner has a lowercase username, this prevents some people from running actions after forking - name: Set repository and image name to lowercase run: | - echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} - echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV} env: - IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + IMAGE_NAME: '${{ github.repository }}' - name: Prepare run: | @@ -127,10 +127,10 @@ jobs: # although the repository owner has a lowercase username, this prevents some people from running actions after forking - name: Set repository and image name to lowercase run: | - echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} - echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV} env: - IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + IMAGE_NAME: '${{ github.repository }}' - name: Prepare run: | @@ -227,10 +227,10 @@ jobs: # although the repository owner has a lowercase username, this prevents some people from running actions after forking - name: Set repository and image name to lowercase run: | - echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} - echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV} env: - IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + IMAGE_NAME: '${{ github.repository }}' - name: Prepare run: | @@ -318,10 +318,10 @@ jobs: # although the repository owner has a lowercase username, this prevents some people from running actions after forking - name: Set repository and image name to lowercase run: | - echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} - echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV} env: - IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + IMAGE_NAME: '${{ github.repository }}' - name: Download digests uses: actions/download-artifact@v4 @@ -373,10 +373,10 @@ jobs: # although the repository owner has a lowercase username, this prevents some people from running actions after forking - name: Set repository and image name to lowercase run: | - echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} - echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV} env: - IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + IMAGE_NAME: '${{ github.repository }}' - name: Download digests uses: actions/download-artifact@v4 @@ -429,10 +429,10 @@ jobs: # although the repository owner has a lowercase username, this prevents some people from running actions after forking - name: Set repository and image name to lowercase run: | - echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} - echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME_MIXED_CASE,,}" >>${GITHUB_ENV} + echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV} + echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV} env: - IMAGE_NAME_MIXED_CASE: '${{ github.repository }}' + IMAGE_NAME: '${{ github.repository }}' - name: Download digests uses: actions/download-artifact@v4