Daily scan #138
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Daily scan | |
on: | |
schedule: | |
- cron: '0 0 * * 1-5' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
attestations: write | |
id-token: write | |
security-events: write | |
actions: read | |
jobs: | |
scan: | |
name: Scan image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Fetch tags | |
shell: bash | |
run: git fetch --tags origin | |
- name: Get previous tag | |
id: previous-tag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
- name: Format version | |
id: version | |
shell: bash | |
run: | | |
TAG=${{ steps.previous-tag.outputs.tag }} | |
VERSION=${TAG#v} | |
echo "VERSION: $VERSION" | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Get GitHub vars | |
id: github | |
uses: ./.github/actions/github | |
- name: Scan image | |
id: scan | |
uses: anchore/scan-action@v6 | |
with: | |
image: 'ghcr.io/${{ steps.github.outputs.repository }}:${{ steps.version.outputs.version }}' | |
cache-db: true | |
fail-build: 'false' | |
severity-cutoff: 'high' | |
output-format: 'sarif' | |
- name: Upload scan report | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: ${{ steps.scan.outputs.sarif }} |