Skip to content

fix(ci): restore advisories for CI lockfile + fix remaining markdownlint #26

fix(ci): restore advisories for CI lockfile + fix remaining markdownlint

fix(ci): restore advisories for CI lockfile + fix remaining markdownlint #26

Workflow file for this run

name: Docker
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
packages: write
security-events: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-scan-push:
name: Build, scan & push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build image (local)
uses: docker/build-push-action@v6
with:
context: .
push: false
load: true
tags: mcp-ssh-bridge:scan
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Trivy vulnerability scan
uses: aquasecurity/trivy-action@master
with:
image-ref: mcp-ssh-bridge:scan
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH
exit-code: 1
- name: Upload Trivy SARIF
if: always() && hashFiles('trivy-results.sarif') != ''
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: trivy-results.sarif
- name: Push to GHCR
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max