From 42d2ddb91c7144540f95401b3f3353d53e834d80 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Wed, 27 Sep 2023 18:17:59 +0200 Subject: [PATCH] Fix actions --- .github/workflows/docker-manual.yml | 6 +++--- .github/workflows/docker-pr.yml | 29 +++-------------------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/docker-manual.yml b/.github/workflows/docker-manual.yml index 909cad5f..24ea7240 100644 --- a/.github/workflows/docker-manual.yml +++ b/.github/workflows/docker-manual.yml @@ -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/hadolint-action@v3.1.0 @@ -59,7 +59,7 @@ jobs: - name: Run Trivy container image vulnerability scanner uses: aquasecurity/trivy-action@0.12.0 with: - image-ref: ${{ steps.meta.outputs.tags }} + image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH }} format: sarif output: trivy-results.sarif diff --git a/.github/workflows/docker-pr.yml b/.github/workflows/docker-pr.yml index a66409ed..f9a6a52e 100644 --- a/.github/workflows/docker-pr.yml +++ b/.github/workflows/docker-pr.yml @@ -14,7 +14,7 @@ env: CONTEXT: . BRANCH: ${{ github.head_ref }} DOCKERFILE_PATH: /ckan - DOCKERFILE: Dockerfile.ghcr + DOCKERFILE: Dockerfile HADOLINT_VERSION: 2.12.0 jobs: @@ -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/hadolint-gh-action@v1.11.0 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/trivy-action@0.12.0 - 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 \ No newline at end of file + error_level: -1 \ No newline at end of file