From d26021f87b7cfec4b3a34fa60fd9290ad821e0d0 Mon Sep 17 00:00:00 2001 From: datadot Date: Sat, 6 Jul 2024 23:45:10 +0100 Subject: [PATCH] Action Updates (#75) * GitHub action uses updates * Docker login and push must be on source project only --------- Co-authored-by: datadot <9027062+datadot@users.noreply.github.com> --- .github/workflows/docker-image.v2.yml | 6 ++++-- .github/workflows/docker-image.v4.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.v2.yml b/.github/workflows/docker-image.v2.yml index edcdd60..9001650 100644 --- a/.github/workflows/docker-image.v2.yml +++ b/.github/workflows/docker-image.v2.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildx id: buildx @@ -70,11 +70,13 @@ jobs: docker tag $CLAIR_LOCAL_SCAN_IMAGE ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${GITHUB_SHA} docker images - name: Login to DockerHub - uses: docker/login-action@v1 + if: github.repository_owner == 'arminc' + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push images + if: github.repository_owner == 'arminc' run: | docker push ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${GITHUB_SHA} docker push $CLAIR_LOCAL_SCAN_IMAGE:latest diff --git a/.github/workflows/docker-image.v4.yml b/.github/workflows/docker-image.v4.yml index 8f8a1cb..1f72c1d 100644 --- a/.github/workflows/docker-image.v4.yml +++ b/.github/workflows/docker-image.v4.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Runner diskspace workaround run: | @@ -88,11 +88,13 @@ jobs: docker tag $CLAIR_LOCAL_SCAN_IMAGE ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${GITHUB_SHA} docker images - name: Login to DockerHub - uses: docker/login-action@v1 + if: github.repository_owner == 'arminc' + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push images + if: github.repository_owner == 'arminc' run: | docker push ${CLAIR_LOCAL_SCAN_IMAGE}:${CLAIR_VERSION}_${GITHUB_SHA} docker push $CLAIR_LOCAL_SCAN_IMAGE:latest