diff --git a/.github/workflows/reusable-trivy.yml b/.github/workflows/reusable-trivy.yml index 11d50c2..8e5ee8d 100644 --- a/.github/workflows/reusable-trivy.yml +++ b/.github/workflows/reusable-trivy.yml @@ -111,6 +111,19 @@ jobs: actions: read packages: read steps: + # image-ref is scanned by digest from the registry (not a local + # docker/containerd/podman image), so Trivy needs an authenticated + # pull — without this, all four of its image-source backends fail, + # including the remote one ("UNAUTHORIZED: authentication required"), + # even for a public GHCR package. Matches sign-and-attest.yml's + # identical login step for the same registry. + - name: Log in to GHCR + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Trivy image vulnerability scan uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 with: