Reusable workflows accept data via inputs
inputs
array to our reusable workflow on:workflow_call:
event${{ inputs.<input-name> }}
with
and secrets
key:values to our calling workflow<org>/actions/.github/workflows/reusable-trivy.yml
inputs
lines under the workflow_call:
eventon:
workflow_call:
inputs:
image:
description: Image to scan
required: true
type: string
trivy
action step at bottom - name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.11.2
with:
image-ref: ${{ inputs.image }}
wordsmith-web
workflow PR<org>/wordsmith-web/.github/workflows/call-trivy.yml
<org>
to yoursjobs:
scan:
name: Scan
uses: <org>/actions/.github/workflows/reusable-trivy.yml@<pr-branch-name>
with:
image: 'ghcr.io/<org>/wordsmith-web:latest'
Commit that and watch the Action run in the wordsmith-web
repo
We now have a working reusable workflow