|
| 1 | +name: "nightly" |
| 2 | +run-name: "Nightly tests for ${{ github.ref_name }}" |
| 3 | + |
| 4 | +on: |
| 5 | + schedule: |
| 6 | + - cron: "22 0 * * *" # Runs daily at 22:00 UTC |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +jobs: |
| 13 | + update-scanners: |
| 14 | + runs-on: ubuntu-24.04 |
| 15 | + steps: |
| 16 | + |
| 17 | + - name: Create github token |
| 18 | + uses: actions/create-github-app-token@v1 |
| 19 | + id: app-token |
| 20 | + with: |
| 21 | + app-id: ${{ vars.ACTIONS_APP_ID }} |
| 22 | + private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} |
| 23 | + owner: ${{ github.repository_owner }} |
| 24 | + |
| 25 | + - name: Checkout repository |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + token: ${{ steps.app-token.outputs.token }} |
| 29 | + |
| 30 | + - name: Set up Python |
| 31 | + uses: actions/setup-python@v5 |
| 32 | + with: |
| 33 | + python-version: 3.12 |
| 34 | + |
| 35 | + - name: Install dependencies |
| 36 | + run: pip install requests |
| 37 | + |
| 38 | + - name: Update scanner versions |
| 39 | + run: python .github/scripts/update_scanners.py |
| 40 | + |
| 41 | + - name: Create Pull Request |
| 42 | + uses: peter-evans/create-pull-request@v7 |
| 43 | + id: pr |
| 44 | + with: |
| 45 | + title: Dependency update |
| 46 | + branch: feature/deps-update |
| 47 | + delete-branch: true |
| 48 | + commit-message: ":arrow_up: Update scanner versions" |
| 49 | + token: ${{ steps.app-token.outputs.token }} |
| 50 | + |
| 51 | + vuln-scan: |
| 52 | + permissions: |
| 53 | + contents: read # for actions/checkout to fetch code |
| 54 | + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results |
| 55 | + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status |
| 56 | + runs-on: ubuntu-24.04 |
| 57 | + steps: |
| 58 | + - name: Checkout |
| 59 | + uses: actions/checkout@v4 |
| 60 | + with: |
| 61 | + path: ./ |
| 62 | + fetch-depth: 0 |
| 63 | + fetch-tags: true |
| 64 | + |
| 65 | + - name: Create SBOM |
| 66 | + uses: anchore/sbom-action@v0 |
| 67 | + with: |
| 68 | + path: ./ |
| 69 | + format: cyclonedx-json |
| 70 | + output-file: "${{ github.event.repository.name }}-sbom.cdx.json" |
| 71 | + |
| 72 | + - name: Scan SBOM |
| 73 | + uses: anchore/scan-action@v6 |
| 74 | + id: scan |
| 75 | + with: |
| 76 | + sbom: "${{ github.event.repository.name }}-sbom.cdx.json" |
| 77 | + output-format: sarif |
| 78 | + fail-build: false |
| 79 | + add-cpes-if-none: true |
| 80 | + by-cve: true |
| 81 | + |
| 82 | + - name: Upload SARIF report |
| 83 | + uses: github/codeql-action/upload-sarif@v3 |
| 84 | + with: |
| 85 | + sarif_file: ${{ steps.scan.outputs.sarif }} |
0 commit comments