From f3bcf4fe93308adf5a1b0e81681cae457eb89485 Mon Sep 17 00:00:00 2001 From: Mindaugas Vidmantas Date: Fri, 8 Dec 2023 15:19:18 +0000 Subject: [PATCH] Update push-to-docker-hub.yml test SNYK --- .github/workflows/push-to-docker-hub.yml | 46 +++++------------------- 1 file changed, 8 insertions(+), 38 deletions(-) diff --git a/.github/workflows/push-to-docker-hub.yml b/.github/workflows/push-to-docker-hub.yml index 5e49ce82..4c483913 100644 --- a/.github/workflows/push-to-docker-hub.yml +++ b/.github/workflows/push-to-docker-hub.yml @@ -1,41 +1,11 @@ -name: Run CI then push to Docker Hub - -on: - push: - tags: - - '*' - branches: - - master - - docharvester - - docharvbasic +name: Workflow for Scala using Snyk +on: push jobs: - push_to_docker_hub: - name: Push Docker image to Docker Hub - # This uses the default metadata-action configuration, see https://github.com/docker/metadata-action - # Pushes to master should build `ukwa/w3act:master`, tags should build `ukwa/w3act:TAG` and update `ukwa/w3act:latest` to refer to TAG. + security: runs-on: ubuntu-latest steps: - - name: Check out the repo - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Fetch tags etc. so git describe will work - - name: Set up Docker metadata - id: meta - uses: docker/metadata-action@v3 - with: - images: ${{ github.repository }} - - name: Set up version variable to embed in container - run: echo "VERSION=`git describe --tags --always`" >> $GITHUB_ENV - - name: Log in to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Build and push to Docker Hub - uses: docker/build-push-action@v2 - with: - build-args: VERSION=${{ env.VERSION }} - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + - uses: actions/checkout@master + - name: Run Snyk to check for vulnerabilities + uses: snyk/actions/scala@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}