-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/integrate docker scout with git hub actions (#564)
* added github action for Docker Scout compare * added Docker Scout step * set correct secrets for DOCKERHUB * upgrade git version * (2.45.1-r0) is not available in the Alpine repositories, and a newer version (2.45.2-r0) is available instead * changed dockerhub secrets to readonly
- Loading branch information
1 parent
6ab5298
commit 1a86b96
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Vulnerability Comparison | ||
|
||
on: | ||
pull_request: | ||
branches: ["**"] | ||
|
||
env: | ||
# Image repository, without hostname and tag | ||
IMAGE_NAME: ${{ github.repository }} | ||
SHA: ${{ github.event.pull_request.head.sha || github.event.after }} | ||
|
||
jobs: | ||
vulnerability-comparison: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.SHA }} | ||
- name: Set short SHA | ||
id: vars | ||
run: echo "SHA_SHORT=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
load: ${{ github.event_name == 'pull_request' }} | ||
tags: "ghcr.io/${{ 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_READONLY_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_READONLY_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 }}" | ||
ignore-unchanged: true | ||
only-severities: critical,high | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters