Skip to content

Commit

Permalink
fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef-Harby committed Nov 28, 2024
1 parent 02de7fa commit 8b97a04
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,29 @@ jobs:
# Sign the resulting Docker image digest except on PRs
- name: Sign the published Docker image
if: github.event_name != 'pull_request'
if: ${{ github.event_name != 'pull_request' }}
env:
# This step uses the identity token to provision an ephemeral certificate
COSIGN_EXPERIMENTAL: "true"
# Remove the extra "sha256:" prefix from the digest
run: |
IMAGE_NAME_LOWER=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
DIGEST="${{ steps.build-and-push.outputs.digest }}"
cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${DIGEST}
cosign sign --yes "${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}@${DIGEST}"
# Run Trivy vulnerability scanner
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
if: github.event_name != 'pull_request'
if: ${{ github.event_name != 'pull_request' }}
with:
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_METADATA_OUTPUT_VERSION }}'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
timeout: '10m'

# Upload Trivy scan results to GitHub Security tab
- name: Upload Trivy scan results to GitHub Security tab
if: ${{ github.event_name != 'pull_request' && always() }}
uses: github/codeql-action/upload-sarif@v3
if: github.event_name != 'pull_request' && always()
with:
sarif_file: 'trivy-results.sarif'
category: 'Trivy'

0 comments on commit 8b97a04

Please sign in to comment.