diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f3938c..5c1b4b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,8 @@ jobs: run: go test -v ./... - name: Log in to the Container registry - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + uses: docker/login-action@v2 + if: github.event_name != 'pull_request' with: registry: ${{ env.REGISTRY }} username: ${{ secrets.REGISTRY_USERNAME }} @@ -51,7 +52,8 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e + uses: docker/metadata-action@v4 + if: github.event_name != 'pull_request' with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | @@ -65,12 +67,12 @@ jobs: with: context: . load: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ github.sha }} - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@0.10.0 with: - image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }} + image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} format: 'table' exit-code: '1' ignore-unfixed: true @@ -89,7 +91,8 @@ jobs: - name: Extract metadata (tags, labels) for Docker (paralus-init) id: meta-init - uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e + uses: docker/metadata-action@v4 + if: github.event_name != 'pull_request' with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-init tags: | @@ -103,7 +106,7 @@ jobs: with: context: . load: true - tags: ${{ steps.meta-init.outputs.tags }} + tags: ${{ github.sha }} - name: Run Trivy vulnerability scanner (paralus-init) uses: aquasecurity/trivy-action@0.10.0 @@ -128,7 +131,8 @@ jobs: - name: Extract metadata (tags, labels) for Docker (kratos-sync) id: meta-sync - uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e + uses: docker/metadata-action@v4 + if: github.event_name != 'pull_request' with: images: ${{ env.REGISTRY }}/paralusio/kratos-synchronizer tags: | @@ -142,12 +146,12 @@ jobs: with: context: . load: true - tags: ${{ steps.meta-sync.outputs.tags }} + tags: ${{ github.sha }} - name: Run Trivy vulnerability scanner (kratos-sync) uses: aquasecurity/trivy-action@0.10.0 with: - image-ref: ${{ env.REGISTRY }}/paralusio/kratos-synchronizer:${{ steps.meta-sync.outputs.tags }} + image-ref: ${{ env.REGISTRY }}/paralusio/kratos-synchronizer:${{ github.sha }} format: 'table' exit-code: '1' ignore-unfixed: true