Trivy Scan Daily #175
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: Trivy Scan Daily | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * 1-5' # Runs at 08:00 UTC on Mon to Friday | |
| jobs: | |
| kubeblocks: | |
| uses: ./.github/workflows/trivy-scan.yml | |
| with: | |
| ITEM: "kubeblocks" | |
| IMAGES: "docker.io/apecloud/kubeblocks:latest|docker.io/apecloud/kubeblocks-tools:latest|docker.io/apecloud/kubeblocks-dataprotection:latest|docker.io/apecloud/kubeblocks-charts:latest" | |
| ADDON: false | |
| secrets: inherit | |
| kbcli: | |
| uses: ./.github/workflows/trivy-scan-repo.yml | |
| with: | |
| ITEM: "kbcli" | |
| secrets: inherit | |
| send-message: | |
| if: ${{ always() }} | |
| runs-on: ubuntu-latest | |
| needs: [ kubeblocks, kbcli ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: apecloud/apecloud-cd | |
| path: ./ | |
| - name: send message | |
| run: | | |
| TEST_RESULT="${{ needs.kubeblocks.outputs.total-vulnerabilities }}" | |
| TEST_RESULT="${TEST_RESULT}##${{ needs.kbcli.outputs.total-vulnerabilities }}" | |
| export TZ='Asia/Shanghai' | |
| date_ret=$(date +%Y-%m-%d-%T) | |
| test_title="[Daily] Trivy Scan Vulnerabilities [${date_ret}]" | |
| python3 .github/utils/send_mesage.py \ | |
| --send-type trivy \ | |
| --url "${{ vars.TEST_BOT_WEBHOOK }}" \ | |
| --title "$test_title" \ | |
| --result "$TEST_RESULT" |