Skip to content

Commit dab4277

Browse files
committed
Extract container registry credentials to workflow inputs
1 parent 3b09b72 commit dab4277

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/check-submission.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ on:
2828
required: false
2929
default: ghcr.io
3030

31+
container-registry-username:
32+
description: Username to container registry
33+
type: string
34+
required: false
35+
default: ${{ github.actor }}
36+
37+
container-registry-password:
38+
description: Password to container registry
39+
type: string
40+
required: false
41+
default: ${{ secrets.GITHUB_TOKEN }}
42+
3143
binder-cache-branch:
3244
description: If set (default), the built container image will be written to .binder/Dockerfile and pushed to this branch. To disable this, set it to the empty string.
3345
type: string
@@ -152,8 +164,8 @@ jobs:
152164
with:
153165
NO_PUSH: "false"
154166
DOCKER_REGISTRY: ${{ inputs.container-registry }}
155-
DOCKER_USERNAME: ${{ github.actor }}
156-
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
167+
DOCKER_USERNAME: ${{ inputs.container-registry-username }}
168+
DOCKER_PASSWORD: ${{ inputs.container-registry-password }}
157169
IMAGE_NAME: ${{ env.NORMALIZED_IMAGE_NAME }}
158170
MYBINDERORG_TAG: ${{ github.sha }}
159171

@@ -167,9 +179,9 @@ jobs:
167179
- name: Login to GitHub Container Registry
168180
uses: docker/login-action@v3
169181
with:
170-
registry: ghcr.io
171-
username: ${{ github.actor }}
172-
password: ${{ secrets.GITHUB_TOKEN }}
182+
registry: ${{ inputs.container-registry }}
183+
username: ${{ inputs.container-registry-username }}
184+
password: ${{ inputs.container-registry-password }}
173185

174186
- name: Run command to test built image ${{ needs.image-build.outputs.image }}
175187
id: run

0 commit comments

Comments
 (0)