Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

popular-containers-vulnerability-checks #467

popular-containers-vulnerability-checks

popular-containers-vulnerability-checks #467

name: popular-containers-vulnerability-checks
on:
workflow_dispatch:
schedule:
- cron: "1 1 * * *"
env:
POPULAR_CONTAINERS_VULNERABILITY_CHECKS_README_FILE: README.md
POPULAR_CONTAINERS_VULNERABILITY_CHECKS_TABLE_FILE: container-vulnerability-table.md
TMP_DIR: /tmp/trivy_output_files
TRIVY_OUTPUT_FILE_DIRECTORY: trivy_output_files
permissions:
contents: write
jobs:
popular-containers-vulnerability-checks:
name: "Scheduled Popular Containers Vulnerability Check"
runs-on: ubuntu-latest
concurrency:
group: popular-containers-vulnerability-checks
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install trivy
run: |
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt update
sudo apt install -y -qq trivy
- name: Run checks
run: |
set -euxo pipefail
./popular-containers-vulnerability-checks.sh "${{ env.TMP_DIR }}" "${{ env.TRIVY_OUTPUT_FILE_DIRECTORY }}" "${{ env.POPULAR_CONTAINERS_VULNERABILITY_CHECKS_TABLE_FILE }}" "${{ env.POPULAR_CONTAINERS_VULNERABILITY_CHECKS_README_FILE }}"
- name: Make container-vulnerability-table nicer
run: |
set -euxo pipefail
npm install -g markdown-table-formatter
markdown-table-formatter container-vulnerability-table.md
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Petr Ruzicka
author_email: petr.ruzicka@gmail.com
message: "docs(readme) Update README.md and add trivy output files"