🦀 Rust API Lint Spectral #149
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
| name: 🦀 Rust API Lint Spectral | |
| on: | |
| push: | |
| branches: ["main", "*"] | |
| paths: | |
| - "swagger.json" | |
| - ".spectral.yaml" | |
| pull_request: | |
| # The branches below must be a subset of the branches above | |
| branches: ["main"] | |
| paths: | |
| - "swagger.json" | |
| - ".spectral.yaml" | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "50 23 * * *" | |
| permissions: | |
| contents: read | |
| jobs: | |
| rust-spectral-analyze: | |
| name: Run rust-spectral analyzing | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| security-events: write | |
| actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Use Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| cache: "yarn" | |
| - name: Install Task | |
| uses: go-task/setup-task@3be4020d41929789a01026e0e427a4321ce0ad44 # v2.0.0 | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Install spectral lint | |
| run: | | |
| yarn add @stoplight/spectral-cli -D | |
| - name: Spectral lint | |
| run: task gen:api-lint | |
| - name: Upload analysis results to GitHub | |
| uses: github/codeql-action/upload-sarif@b8bb9f28b8d3f992092362369c57161b755dea45 # v4.35.0 | |
| with: | |
| sarif_file: spectral-report.sarif | |
| wait-for-processing: true |