Skip to content

Getting unauthorised for github container registry #232

@Sabreen-Parveen

Description

@Sabreen-Parveen

I am using this action to scan images present in github container registry, I have set the registery-username variable to my username and have used ${{ secrets.GITHUB_TOKEN }} for my password. But when the action is running it is giving me unauthorised. To authenticate with GITHUB_TOKEN, I have followed this github doc.

My github action:

scan:
    name: 🛡️ Scan docker images
    runs-on: ubuntu-latest
    permissions:
      packages: read
      contents: read
    needs: get_images
    strategy:
      fail-fast: false
      matrix: ${{ fromJSON(needs.get_images.outputs.images) }}
    steps:
      - name: scan ghcr images
        uses: anchore/scan-action@v3
        if: ${{ startsWith( matrix.images, 'ghcr.io' ) }}
        id: scan-ghcr
        with:
         image: ${{ matrix.images }}
         fail-build: true
         severity-cutoff: critical
         output-format: json
         registry-username: sabreen-parveen
         registry-password: ${{ secrets.GITHUB_TOKEN }}

Error

Getting following warning and error message:
image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions