Skip to content

Bump anchore/scan-action from 6.0.0 to 6.1.0 #266

Bump anchore/scan-action from 6.0.0 to 6.1.0

Bump anchore/scan-action from 6.0.0 to 6.1.0 #266

Workflow file for this run

---
name: Pull Requests
# build, test and scan PRs into dev, main branches
on:
pull_request:
branches:
- main
- dev
paths-ignore:
- '**.md'
- mkdocs.yml
- .github/workflows/mkdocs.yml
env:
IMAGE_NAME: jsloan117/docker-openvpn-client
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build-scan:
runs-on: ubuntu-latest
permissions: {}
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@v4
# https://github.com/marketplace/actions/docker-metadata-action
- name: Docker Metadata
uses: docker/metadata-action@v5.6.1
id: meta
with:
images: ${{ env.IMAGE_NAME }}
flavor: latest=false
tags: type=ref,event=pr
# https://github.com/marketplace/actions/docker-setup-qemu
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.3.0
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.8.0
with:
install: true
version: latest
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build Test Image
uses: docker/build-push-action@v6.12.0
with:
tags: ${{ steps.meta.outputs.tags }}
push: false
load: true
# https://github.com/marketplace/actions/anchore-sbom-action
- name: Anchore SBOM Action
uses: anchore/sbom-action@v0.17.9
with:
image: ${{ steps.meta.outputs.tags }}
# https://github.com/marketplace/actions/anchore-container-scan
- name: Anchore Container Scan
uses: anchore/scan-action@v6.1.0
id: scan
with:
image: ${{ steps.meta.outputs.tags }}
fail-build: true
severity-cutoff: critical
- name: Set Sarif Report artifact variable
run: |
echo "sarif_artifact=$(echo ${image_tag} | sed -e 's|/|-|g' -e 's|:|_|g').sarif" >> $GITHUB_ENV
env:
image_tag: ${{ steps.meta.outputs.tags }}
# https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload Sarif Report
uses: actions/upload-artifact@v4.6.0
with:
name: ${{ env.sarif_artifact }}
path: ${{ steps.scan.outputs.sarif }}
if-no-files-found: warn
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build Image
uses: docker/build-push-action@v6.12.0
with:
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: false
load: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}