Skip to content

Commit

Permalink
Login GHCR to combat Trivy db 429
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx committed Sep 19, 2024
1 parent 9ac7974 commit 99a8cc9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,10 @@ inputs:
What container registry to use, either `acr` or `ghcr`.
If set to `acr`, credentials for Azure Container Registry will default to Elvia values.
You can also set these explictly to point to your own ACR.
If set to `ghcr`, the action will use the GitHub Container Registry.
This requires `github-token` to be set, and the `packages: write` permission.'
If set to `ghcr`, the action will use the GitHub Container Registry,
which requires the `packages: write` permission to be set for the job.
required: false
default: 'acr'
github-token:
description: 'GitHub token for GitHub Container Registry. **Required if `registry` is set to `ghcr`**. Should normally be `secrets.GITHUB_TOKEN`.'
required: false
AZURE_CLIENT_ID:
description: 'ClientId of a service principal that can push to Azure Container Registry.'
required: false
Expand Down Expand Up @@ -137,13 +134,13 @@ runs:
# Login to ACR
az acr login --name '${{ inputs.ACR_NAME }}'
# Also used to not get 429 when downloading Trivy database
- name: Login to Github Container Registry
if: ${{ inputs.registry == 'ghcr' }}
uses: docker/login-action@v3
with:
registry: 'ghcr.io'
username: ${{ github.actor }}
password: ${{ inputs.github-token }}
password: ${{ github.token }}

- name: Setup Trivy ignore file
shell: bash
Expand Down

0 comments on commit 99a8cc9

Please sign in to comment.