|
| 1 | +# Configuration from: |
| 2 | +# https://github.com/johnbillion/plugin-infrastructure/blob/571cba96190304963285181e2b928d941b9ec7c4/.github/workflows/reusable-workflow-lint.yml |
| 3 | + |
| 4 | +name: Lint GitHub Actions workflows |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - "2.3.x" |
| 10 | + |
| 11 | +permissions: {} |
| 12 | + |
| 13 | +jobs: |
| 14 | + actionlint: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Harden the runner (Audit all outbound calls) |
| 18 | + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 |
| 19 | + with: |
| 20 | + egress-policy: audit |
| 21 | + |
| 22 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 23 | + - name: Check workflow files |
| 24 | + run: | |
| 25 | + echo "::add-matcher::.github/actionlint-matcher.json" |
| 26 | + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) |
| 27 | + ./actionlint -color |
| 28 | + shell: bash |
| 29 | + |
| 30 | + octoscan: |
| 31 | + name: Octoscan |
| 32 | + runs-on: ubuntu-latest |
| 33 | + permissions: |
| 34 | + security-events: write # Required for codeql-action/upload-sarif to upload SARIF files. |
| 35 | + timeout-minutes: 10 |
| 36 | + steps: |
| 37 | + - name: Harden the runner (Audit all outbound calls) |
| 38 | + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 |
| 39 | + with: |
| 40 | + egress-policy: audit |
| 41 | + |
| 42 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 43 | + - name: Run octoscan |
| 44 | + id: octoscan |
| 45 | + uses: synacktiv/action-octoscan@6b1cf2343893dfb9e5f75652388bd2dc83f456b0 # v1.0.0 |
| 46 | + with: |
| 47 | + filter_triggers: '' |
| 48 | + |
| 49 | + - name: Upload SARIF file to GitHub |
| 50 | + uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 |
| 51 | + with: |
| 52 | + sarif_file: "${{steps.octoscan.outputs.sarif_output}}" |
| 53 | + category: octoscan |
| 54 | + wait-for-processing: false |
| 55 | + |
| 56 | + poutine: |
| 57 | + name: Poutine |
| 58 | + runs-on: ubuntu-latest |
| 59 | + permissions: |
| 60 | + security-events: write # Required for codeql-action/upload-sarif to upload SARIF files. |
| 61 | + steps: |
| 62 | + - name: Harden the runner (Audit all outbound calls) |
| 63 | + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 |
| 64 | + with: |
| 65 | + egress-policy: audit |
| 66 | + |
| 67 | + - name: Checkout repository |
| 68 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 69 | + with: |
| 70 | + persist-credentials: false |
| 71 | + |
| 72 | + - name: Run Poutine |
| 73 | + uses: boostsecurityio/poutine-action@84c0a0d32e8d57ae12651222be1eb15351429228 # v0.15.2 |
| 74 | + |
| 75 | + - name: Upload poutine SARIF file |
| 76 | + uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 |
| 77 | + with: |
| 78 | + sarif_file: results.sarif |
| 79 | + category: poutine |
| 80 | + wait-for-processing: false |
| 81 | + |
| 82 | + zizmor: |
| 83 | + name: Zizmor |
| 84 | + runs-on: ubuntu-latest |
| 85 | + permissions: |
| 86 | + security-events: write # Required for codeql-action/upload-sarif to upload SARIF files. |
| 87 | + steps: |
| 88 | + - name: Harden the runner (Audit all outbound calls) |
| 89 | + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 |
| 90 | + with: |
| 91 | + egress-policy: audit |
| 92 | + |
| 93 | + - name: Checkout repository |
| 94 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 95 | + with: |
| 96 | + persist-credentials: false |
| 97 | + |
| 98 | + - name: Install the latest version of uv |
| 99 | + uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0 |
| 100 | + with: |
| 101 | + enable-cache: false |
| 102 | + |
| 103 | + - name: Run zizmor |
| 104 | + run: uvx zizmor@1.20.0 --persona=auditor --format=sarif --strict-collection . > results.sarif |
| 105 | + env: |
| 106 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 107 | + |
| 108 | + - name: Upload SARIF file |
| 109 | + uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 |
| 110 | + with: |
| 111 | + sarif_file: results.sarif |
| 112 | + category: zizmor |
| 113 | + wait-for-processing: false |
0 commit comments