Skip to content

Commit 4fc967f

Browse files
Merge pull request #10 from sbouchexbellomie-Philips/auth
Added registry server authentication
2 parents b48fca0 + 0939028 commit 4fc967f

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ and work path.
4848
| extra_args | Extra arguments for docker run command. | `false` | |
4949
| pre-warm | Run a warming-up container (which might crash due to first time use failure) | `false` | true |
5050
| pre-warm-cmd | Pre warm command to run inside the container | `false` | echo "warming up!" |
51+
| registry_authentication | Enable authentication on the registry server | `false` | `false`
52+
| registry_username | Registry server username | `false`
53+
| registry_token | Registry server token | `false`
54+
| registry_repository | Registry server repository | `false`
5155

5256

5357

action.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,19 @@ inputs:
4545
description: 'Pre warm command to run inside the container'
4646
required: false
4747
default: 'echo "warming up!"'
48-
48+
registry_authentication:
49+
description : 'Authenticate against registry server'
50+
required : false
51+
default: 'false'
52+
registry_username:
53+
description: 'Docker registry username.'
54+
required: false
55+
registry_token:
56+
description: 'Docker registry token'
57+
required: false
58+
registry_repository:
59+
description: 'Docker registry repository'
60+
required: false
4961

5062
runs:
5163
using: "composite"
@@ -62,6 +74,12 @@ runs:
6274
${{github.action_path}}/src/parse_input_paths.ps1 -githubWorkSpace "${{ github.workspace }}" -workspacePath "@${{ inputs.workspace_path }}" -mappingPath "@${{ inputs.mapping_path }}" -workPath "@${{ inputs.work_path }}";
6375
${{github.action_path}}/src/parse_input_extra_args.ps1 -envNames "@${{ inputs.env_names }}" -entryPoint "@${{ inputs.entrypoint }}" -extraArgs "@${{ inputs.extra_args }}";
6476
shell: powershell
77+
- name: docker_login
78+
id: docker_login
79+
if: inputs.registry_authentication == 'true'
80+
shell: powershell
81+
run: >-
82+
docker login ${{ inputs.registry_repository }} -u ${{ inputs.registry_username }} -p ${{ inputs.registry_token }}
6583
- name: Pre-warm
6684
if: inputs.pre-warm == 'true'
6785
run: |
@@ -84,3 +102,9 @@ runs:
84102
${{ inputs.run }}
85103
}
86104
shell: powershell
105+
- name: docker_logout
106+
id: docker_logout
107+
if: inputs.registry_authentication == 'true'
108+
shell: powershell
109+
run: >-
110+
docker logout ${{ inputs.registry_repository }}

0 commit comments

Comments
 (0)