Skip to content

Uses snyk instead of docker_scan-lint #7

Uses snyk instead of docker_scan-lint

Uses snyk instead of docker_scan-lint #7

Workflow file for this run

name: Build ckan-pycsw-dev images
on:
push:
branches:
- main
- latest
tags:
- 'v*.*.*'
pull_request:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-dev
CONTEXT: .
DOCKERFILE_PATH: /ckan-pycsw
DOCKERFILE: Dockerfile.dev
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: ${{ env.CONTEXT }}
file: ${{ env.CONTEXT }}${{ env.DOCKERFILE_PATH }}/${{ env.DOCKERFILE }}
scan_docker_image:
permissions:
id-token: read

Check failure on line 60 in .github/workflows/docker-dev.yaml

View workflow run for this annotation

GitHub Actions / Build ckan-pycsw-dev images

Invalid workflow file

The workflow is not valid. .github/workflows/docker-dev.yaml (Line: 60, Col: 17): Unexpected value 'read'
contents: read
packages: read
runs-on: ubuntu-latest
needs: [ docker ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Scan Docker image
uses: snyk/actions/docker@master
continue-on-error: true
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
args: --file=Dockerfile --severity-threshold=high --sarif-file-output=snyk.sarif
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Upload Snyk report as sarif
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk.sarif