Skip to content

Commit

Permalink
feat(scan-images): support logging in to secondary registry
Browse files Browse the repository at this point in the history
ING-4250
  • Loading branch information
stempler committed Jun 25, 2024
1 parent 8db3e0b commit 5c14dfc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/scan-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ on:
description: If the merged SBOM should be scanned to create an aggregated HTML report (prone to failure as trivy does not accept many merged SBOMs)
type: boolean
default: false
secondaryRegistry:
description: 'Optional secondary registry to login to'
type: string
required: false
default: ''
secrets:
# GH_PAT:
# required: true
Expand All @@ -38,6 +43,11 @@ on:
DOCKER_HUB_PASSWORD:
required: true
DOCKER_HUB_EMAIL:
required: false
SECONDARY_REGISTRY_PASSWORD:
required: false
SECONDARY_REGISTRY_USERNAME:
required: false

jobs:
scan:
Expand All @@ -56,6 +66,14 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Login to secondary registry
if: inputs.secondaryRegistry != ''
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ${{ inputs.secondaryRegistry }}
username: ${{ secrets.SECONDARY_REGISTRY_USERNAME }}
password: ${{ secrets.SECONDARY_REGISTRY_PASSWORD }}

- name: Pull image
if: ${{ inputs.pull }}
shell: bash
Expand Down

0 comments on commit 5c14dfc

Please sign in to comment.