Skip to content

Commit

Permalink
Fix auth error
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Jun 7, 2024
1 parent 170435f commit e0842ae
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/vulnerability-comparison.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ on:

env:
# Image repository, without hostname and tag
IMAGE_NAME: ${{ github.repository }}
REGISTRY: docker.io
IMAGE_NAME: "gatewaydio/gatewayd"
SHA: ${{ github.event.pull_request.head.sha || github.event.after }}
COMPARE_TAG: latest

jobs:
vulnerability-comparison:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
steps:
- name: Checkout code
Expand All @@ -22,28 +26,31 @@ jobs:
- name: Set short SHA
id: vars
run: echo "SHA_SHORT=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
load: ${{ github.event_name == 'pull_request' }}
tags: "ghcr.io/${{ env.IMAGE_NAME }}:${{ env.SHA_SHORT }}"
tags: "${{ env.IMAGE_NAME }}:${{ env.SHA_SHORT }}"
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Authenticate to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Scout
id: docker-scout
uses: docker/scout-action@v1
with:
command: compare
image: "gatewaydio/gatewayd:latest"
to: "ghcr.io/${{ env.IMAGE_NAME }}:${{ env.SHA_SHORT }}"
image: "${{ env.IMAGE_NAME }}:${{ env.COMPARE_TAG }}"
to: "${{ env.IMAGE_NAME }}:${{ env.SHA_SHORT }}"
ignore-unchanged: true
only-severities: critical,high
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit e0842ae

Please sign in to comment.