Skip to content

Commit

Permalink
Move env var CONTAINER_IMAGE_REGISTRY to an optional input since GitH…
Browse files Browse the repository at this point in the history
…ub Actions files do not support env vars.
  • Loading branch information
junhaoliao committed Mar 9, 2024
1 parent 13dd153 commit b1109b2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/actions/clp-execution-image-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ 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
platformId:
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:
Expand All @@ -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}}"

Expand All @@ -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'"
Expand Down

0 comments on commit b1109b2

Please sign in to comment.