|
| 1 | +name: Lint GitHub Actions |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - trunk |
| 7 | + - '[0-9].[0-9]' |
| 8 | + tags: |
| 9 | + - '[0-9]+.[0-9]' |
| 10 | + - '[0-9]+.[0-9].[0-9]+' |
| 11 | + paths: |
| 12 | + # Only run when changes are made to workflow files. |
| 13 | + - '.github/workflows/**' |
| 14 | + pull_request: |
| 15 | + branches: |
| 16 | + - trunk |
| 17 | + - '[0-9].[0-9]' |
| 18 | + paths: |
| 19 | + # Only run when changes are made to workflow files. |
| 20 | + - '.github/workflows/**' |
| 21 | + workflow_dispatch: |
| 22 | + |
| 23 | +# Cancels all previous workflow runs for pull requests that have not completed. |
| 24 | +concurrency: |
| 25 | + # The concurrency group contains the workflow name and the branch name for pull requests |
| 26 | + # or the commit hash for any other events. |
| 27 | + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} |
| 28 | + cancel-in-progress: true |
| 29 | + |
| 30 | +# Disable permissions for all available scopes by default. |
| 31 | +# Any needed permissions should be configured at the job level. |
| 32 | +permissions: {} |
| 33 | + |
| 34 | +jobs: |
| 35 | + actionlint: |
| 36 | + name: Actionlint |
| 37 | + runs-on: ubuntu-latest |
| 38 | + permissions: |
| 39 | + contents: read |
| 40 | + timeout-minutes: 5 |
| 41 | + steps: |
| 42 | + - name: Checkout repository |
| 43 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 44 | + |
| 45 | + - name: Run actionlint |
| 46 | + uses: docker://rhysd/actionlint:1.7.4 |
| 47 | + with: |
| 48 | + args: "-color -verbose=" |
| 49 | + |
| 50 | + octoscan: |
| 51 | + name: Octoscan |
| 52 | + runs-on: ubuntu-24.04 |
| 53 | + permissions: |
| 54 | + contents: read |
| 55 | + timeout-minutes: 10 |
| 56 | + steps: |
| 57 | + - name: Checkout repository |
| 58 | + uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + persist-credentials: false |
| 61 | + |
| 62 | + - name: Checkout Octoscan |
| 63 | + uses: actions/checkout@v4 |
| 64 | + with: |
| 65 | + repository: synacktiv/octoscan |
| 66 | + path: octoscan |
| 67 | + persist-credentials: false |
| 68 | + |
| 69 | + - name: Set up Go |
| 70 | + uses: actions/setup-go@v5 |
| 71 | + with: |
| 72 | + go-version: '1.21' |
| 73 | + |
| 74 | + - name: Install and build Octoscan |
| 75 | + run: | #shell |
| 76 | + cd octoscan |
| 77 | + go mod tidy |
| 78 | + go build |
| 79 | +
|
| 80 | + - name: Run Octoscan |
| 81 | + run: | #shell |
| 82 | + ./octoscan/octoscan scan . |
| 83 | +
|
| 84 | + zizmor: |
| 85 | + name: Zizmor |
| 86 | + runs-on: ubuntu-24.04 |
| 87 | + permissions: |
| 88 | + security-events: write |
| 89 | + actions: read |
| 90 | + contents: read |
| 91 | + steps: |
| 92 | + - name: Checkout repository |
| 93 | + uses: actions/checkout@v4 |
| 94 | + with: |
| 95 | + persist-credentials: false |
| 96 | + |
| 97 | + - name: Install the latest version of uv |
| 98 | + uses: astral-sh/setup-uv@v4 |
| 99 | + |
| 100 | + - name: Run zizmor |
| 101 | + run: uvx zizmor . |
| 102 | + env: |
| 103 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments