Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: scheduled trivy scan workflow #363

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Scan


on:
workflow_dispatch:
inputs:
supported_releases_number:
description: 'Number of supported releases'
type: number
default: 1
schedule:
# run every day at 3:07am UTC
- cron: '7 3 * * *'

permissions:
security-events: write

env:
SUPPORTED_RELEASES_NUMBER: '1'
# comma separated list of images, without tag
IMAGES: "xpkg.upbound.io/upbound/provider-gcp"

jobs:
setup-vars:
runs-on: ubuntu-22.04
outputs:
supported_releases_number: ${{ steps.setup.outputs.supported_releases_number }}
images: ${{ steps.setup.outputs.images }}
steps:
- name: Setup outputs
shell: bash
id: setup
run: |
supported_releases_number="${{ fromJSON(inputs.supported_releases_number || env.SUPPORTED_RELEASES_NUMBER) }}"
echo "supported_releases_number=${supported_releases_number}" >> $GITHUB_OUTPUT

images="${{ env.IMAGES }}"
echo "images=${images}" >> $GITHUB_OUTPUT

echo "We are going to scan the last ${supported_releases_number} releases for: ${images}"

scan:
uses: upbound/uptest/.github/workflows/scan.yml@main
needs:
- setup-vars
with:
images: ${{ needs.setup-vars.outputs.images }}
supported_releases: ${{ fromJSON(needs.setup-vars.outputs.supported_releases_number) }}