scout #1
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
name: Docker | |
on: | |
workflow_run: | |
workflows: [dbc] | |
types: | |
- completed | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: docker.io | |
IMAGE_NAME: olegselajev241/todo-demo-application | |
SHA: ${{ github.event.pull_request.head.sha || github.event.after }} | |
# Use `latest` as the tag to compare to if empty, assuming that it's already pushed | |
COMPARE_TAG: latest | |
jobs: | |
scout: | |
runs-on: ubuntu-latest | |
steps: | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
labels: | | |
org.opencontainers.image.revision=${{ env.SHA }} | |
tags: | | |
type=edge,branch=$repo.default_branch | |
type=semver,pattern=v{{version}} | |
type=sha,prefix=,suffix=,format=shorts | |
- name: Docker Scout | |
id: docker-scout | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: docker/scout-action@v1 | |
with: | |
command: compare | |
image: ${{ steps.meta.outputs.tags }} | |
to: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMPARE_TAG }} | |
ignore-unchanged: true | |
only-severities: critical,high | |
write-comment: false |