From b1109b2e69fa642807a00975805f081e2bf12cd5 Mon Sep 17 00:00:00 2001 From: Junhao Liao Date: Sat, 9 Mar 2024 16:38:17 -0500 Subject: [PATCH] Move env var CONTAINER_IMAGE_REGISTRY to an optional input since GitHub Actions files do not support env vars. --- .../actions/clp-execution-image-build/action.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/actions/clp-execution-image-build/action.yaml b/.github/actions/clp-execution-image-build/action.yaml index 9294aaf42..b4021ee6b 100644 --- a/.github/actions/clp-execution-image-build/action.yaml +++ b/.github/actions/clp-execution-image-build/action.yaml @@ -3,6 +3,10 @@ description: "Builds a container image that contains the dependencies necessary to run the CLP package." inputs: + containerImageRegistry: + description: "Container Image Registry" + required: false + default: "ghcr.io" dockerfilePath: description: "Path to the Dockerfile." required: true @@ -10,13 +14,10 @@ inputs: description: "Platform ID of the container. e.g., ubuntu." required: true platformVersionId: - description: "Platform VERSION_ID / VERSION_CODENAME of the container. + description: "Platform VERSION_ID / VERSION_CODENAME of the container. e.g., jammy, focal." required: true -env: - CONTAINER_IMAGE_REGISTRY: "ghcr.io" - runs: using: "composite" steps: @@ -30,7 +31,7 @@ runs: - uses: "docker/login-action@v3" with: - registry: "${{env.CONTAINER_IMAGE_REGISTRY}}" + registry: "${{inputs.containerImageRegistry}}" username: "${{github.actor}}" password: "${{secrets.GITHUB_TOKEN}}" @@ -45,7 +46,7 @@ runs: - id: "meta" uses: "docker/metadata-action@v5" with: - images: "${{env.CONTAINER_IMAGE_REGISTRY}}/${{steps.sanitization.outputs.REPOSITORY}}\ + images: "${{inputs.containerImageRegistry}}/${{steps.sanitization.outputs.REPOSITORY}}\ /clp-execution-x86-${{inputs.platformId}}-${{inputs.platformVersionId}}" - if: "github.event_name != 'pull_request' && github.ref == 'refs/heads/main'"