From 63ab1b9009012369ae5ffda2c45e0211d9e5e88d Mon Sep 17 00:00:00 2001 From: Pedro Tashima Date: Thu, 5 Dec 2024 16:17:29 -0300 Subject: [PATCH] bypass docker.io lock on ecm distro tools (#511) * check if the repository is ecm distro tools * trim the repo owner --- actions/publish-image/action.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/actions/publish-image/action.yaml b/actions/publish-image/action.yaml index b3262209..20006b65 100644 --- a/actions/publish-image/action.yaml +++ b/actions/publish-image/action.yaml @@ -131,12 +131,15 @@ runs: shell: bash if: ${{ inputs.push-to-prime == true || inputs.push-to-prime == 'true' }} run: | + export GITHUB_REPOSITORY=${{ github.repository }} + GITHUB_REPOSITORY="${GITHUB_REPOSITORY#*/}" # trim the owner + if [[ -z "${REGISTRY}" ]]; then echo "Prime registry cannot be empty" exit 1 fi - if [[ "${REGISTRY}" == "docker.io" ]]; then + if [[ "${REGISTRY}" == "docker.io" ]] && [[ "${GITHUB_REPOSITORY}" != "ecm-distro-tools" ]]; then echo "Prime registry cannot be docker.io" exit 2 fi