Skip to content

Commit

Permalink
Fix actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanez committed Sep 27, 2023
1 parent 83ecd02 commit 42d2ddb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
push: true
tags: ${{ env.TAG }}
labels: ${{ steps.meta.outputs.labels }}
context: ./ckan
file: ./ckan/Dockerfile
context: ${{ env.CONTEXT }}
file: ${{ env.CONTEXT }}${{ env.DOCKERFILE_PATH }}/${{ env.DOCKERFILE }}

- name: Linting Dockerfile with hadolint in GH Actions
uses: hadolint/[email protected]
Expand All @@ -59,7 +59,7 @@ jobs:
- name: Run Trivy container image vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: ${{ steps.meta.outputs.tags }}
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH }}
format: sarif
output: trivy-results.sarif

Expand Down
29 changes: 3 additions & 26 deletions .github/workflows/docker-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
CONTEXT: .
BRANCH: ${{ github.head_ref }}
DOCKERFILE_PATH: /ckan
DOCKERFILE: Dockerfile.ghcr
DOCKERFILE: Dockerfile
HADOLINT_VERSION: 2.12.0

jobs:
Expand Down Expand Up @@ -78,34 +78,11 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build to test
uses: docker/build-push-action@v5
id: docker-push
with:
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: ./ckan
file: ./ckan/Dockerfile.ghcr

- name: Linting Dockerfile and annotate code inline in the github PR viewer
id: hadolint
uses: jbergstroem/[email protected]
with:
dockerfile: ./ckan/Dockerfile.ghcr
dockerfile: ${{ env.CONTEXT }}${{ env.DOCKERFILE_PATH }}/${{ env.DOCKERFILE }}
version: ${{ env.HADOLINT_VERSION }}
annotate: true
error_level: -1

- name: Run Trivy container image vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: ${{ steps.meta.outputs.tags }}
format: sarif
output: trivy-results.sarif

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: trivy-results.sarif
error_level: -1

0 comments on commit 42d2ddb

Please sign in to comment.