Validate Actions #84
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
| --- | |
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
| name: Validate Actions | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - '.github/**' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/**' | |
| schedule: | |
| - cron: '22 2 * * *' | |
| permissions: {} | |
| jobs: | |
| actionlint: | |
| name: Run actionlint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| - name: Check workflows with actionlint | |
| run: uvx --from actionlint-py actionlint -color | |
| zizmor: | |
| name: Run zizmor | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| security-events: write # integration with github advanced security | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| - name: Run zizmor | |
| run: uvx zizmor --pedantic --format=sarif . > results.sarif | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # run offline for branches and PRs to avoid rate limits | |
| ZIZMOR_OFFLINE: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} | |
| - name: Upload SARIF file | |
| uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 | |
| with: | |
| sarif_file: results.sarif | |
| category: zizmor |