Skip to content

Commit

Permalink
fix gh case sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef-Harby committed Nov 28, 2024
1 parent d06b007 commit 02de7fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ on:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# github.repository_owner is automatically converted to lowercase
IMAGE_NAME: ${{ github.repository_owner }}/pygeoapi-map

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write # Needed for signing
security-events: write # Needed for GitHub Security tab
id-token: write
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Install the cosign tool except on PR
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.3.0
Expand Down Expand Up @@ -57,7 +57,6 @@ jobs:
type=sha,format=long
type=raw,value=latest,enable={{is_default_branch}}
# Build and push Docker image with Buildx
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
Expand All @@ -77,22 +76,27 @@ jobs:
if: github.event_name != 'pull_request'
env:
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
COSIGN_EXPERIMENTAL: "true"
run: echo "${{ steps.build-and-push.outputs.digest }}" | cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:${{ steps.build-and-push.outputs.digest }}
# Remove the extra "sha256:" prefix from the digest
run: |
DIGEST="${{ steps.build-and-push.outputs.digest }}"
cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${DIGEST}
# Run Trivy vulnerability scanner
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
if: github.event_name != 'pull_request'
with:
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
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
uses: github/codeql-action/upload-sarif@v3
if: always()
if: github.event_name != 'pull_request' && always()
with:
sarif_file: 'trivy-results.sarif'
category: 'Trivy'
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM node:18-alpine as build-stage
FROM node:20-alpine as build-stage

WORKDIR /app

Expand Down

0 comments on commit 02de7fa

Please sign in to comment.