From 8fcf15dcbb8035644ed49e65bf40cde56a06ca82 Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Wed, 6 Nov 2024 19:21:05 -0600 Subject: [PATCH] [CI] Schedule Trivy scan for maintenance branches --- .../workflows/trivy-scan-dispatcher-1.0.x.yml | 25 +++++++++++++++++++ .../workflows/trivy-scan-dispatcher-1.1.x.yml | 25 +++++++++++++++++++ .github/workflows/trivy-scan.yml | 2 +- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/trivy-scan-dispatcher-1.0.x.yml create mode 100644 .github/workflows/trivy-scan-dispatcher-1.1.x.yml diff --git a/.github/workflows/trivy-scan-dispatcher-1.0.x.yml b/.github/workflows/trivy-scan-dispatcher-1.0.x.yml new file mode 100644 index 00000000..15d972b3 --- /dev/null +++ b/.github/workflows/trivy-scan-dispatcher-1.0.x.yml @@ -0,0 +1,25 @@ +name: Trivy Vulnerability Scan (Repo mode) Dispatcher (1.0.x) + +on: + schedule: + - cron: '0 15 * * */3' # Once every 3 day at 15:00 UTC + workflow_dispatch: + +jobs: + dispatch_trivy_workflow: + name: Dispatch scan workflow + if: github.repository == 'spring-projects/spring-pulsar' + strategy: + matrix: + # List of active maintenance branches. + branch: [ 1.0.x ] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Dispatch + env: + GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} + run: gh workflow run trivy-scan.yml -r ${{ matrix.branch }} diff --git a/.github/workflows/trivy-scan-dispatcher-1.1.x.yml b/.github/workflows/trivy-scan-dispatcher-1.1.x.yml new file mode 100644 index 00000000..68541596 --- /dev/null +++ b/.github/workflows/trivy-scan-dispatcher-1.1.x.yml @@ -0,0 +1,25 @@ +name: Trivy Vulnerability Scan (Repo mode) Dispatcher (1.1.x) + +on: + schedule: + - cron: '0 16 * * */3' # Once every 3 day at 16:00 UTC + workflow_dispatch: + +jobs: + dispatch_trivy_workflow: + name: Dispatch scan workflow + if: github.repository == 'spring-projects/spring-pulsar' + strategy: + matrix: + # List of active maintenance branches. + branch: [ 1.1.x ] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Dispatch + env: + GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} + run: gh workflow run trivy-scan.yml -r ${{ matrix.branch }} diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index ac1bc68b..08f98900 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -26,7 +26,7 @@ on: required: false type: boolean schedule: - - cron: '0 14 * * */3' # Once every 3 day at 2pm UTC + - cron: '0 14 * * */3' # Once every 3 day at 14:00 UTC jobs: run_trivy_scan: