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