From 0bdb01a9e967199ca15d611f2d53a219bde37588 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Mon, 19 Feb 2024 11:19:59 -0500 Subject: [PATCH] Allow dev image to build on fork (#14898) * Allow dev image to build on fork Fix uppercase repo owner error in CI example ``` Run docker pull ghcr.io/TheRealHaoLiu/awx_devel:devel docker pull ghcr.io/TheRealHaoLiu/awx_devel:devel shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} env: LC_ALL: C.UTF-8 CI_GITHUB_TOKEN: *** DEV_DOCKER_OWNER: TheRealHaoLiu COMPOSE_TAG: devel py_version: 3 invalid reference format: repository name must be lowercase ``` --------- Co-authored-by: Rick Elrod --- .github/actions/awx_devel_image/action.yml | 10 ++++++++-- .github/actions/run_awx_devel/action.yml | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/actions/awx_devel_image/action.yml b/.github/actions/awx_devel_image/action.yml index 8b7081292b..0d7ea9ac37 100644 --- a/.github/actions/awx_devel_image/action.yml +++ b/.github/actions/awx_devel_image/action.yml @@ -11,6 +11,12 @@ runs: shell: bash run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV + - name: Set lower case owner name + shell: bash + run: echo "OWNER_LC=${OWNER,,}" >> $GITHUB_ENV + env: + OWNER: '${{ github.repository_owner }}' + - name: Log in to registry shell: bash run: | @@ -18,11 +24,11 @@ runs: - name: Pre-pull latest devel image to warm cache shell: bash - run: docker pull ghcr.io/${{ github.repository_owner }}/awx_devel:${{ github.base_ref }} + run: docker pull ghcr.io/${OWNER_LC}/awx_devel:${{ github.base_ref }} - name: Build image for current source checkout shell: bash run: | - DEV_DOCKER_TAG_BASE=ghcr.io/${{ github.repository_owner }} \ + DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER_LC} \ COMPOSE_TAG=${{ github.base_ref }} \ make docker-compose-build diff --git a/.github/actions/run_awx_devel/action.yml b/.github/actions/run_awx_devel/action.yml index 57dcb54b42..d1f688bcdf 100644 --- a/.github/actions/run_awx_devel/action.yml +++ b/.github/actions/run_awx_devel/action.yml @@ -35,7 +35,7 @@ runs: - name: Start AWX shell: bash run: | - DEV_DOCKER_TAG_BASE=ghcr.io/${{ github.repository_owner }} \ + DEV_DOCKER_OWNER=${{ github.repository_owner }} \ COMPOSE_TAG=${{ github.base_ref }} \ COMPOSE_UP_OPTS="-d" \ make docker-compose