|
20 | 20 | strategy: |
21 | 21 | matrix: |
22 | 22 | os: [macos-latest, windows-latest, ubuntu-latest] |
| 23 | + permissions: |
| 24 | + contents: read |
| 25 | + pull-requests: write |
23 | 26 | steps: |
24 | 27 | - run: echo "${{ github.actor }}" |
25 | 28 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
|
40 | 43 | uses: mui/mui-public/.github/actions/ci-publish@3feee347096f50b441cad3087743bd1c5aef8651 |
41 | 44 | with: |
42 | 45 | pr-comment: true |
| 46 | + - name: Extract Vale version |
| 47 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 48 | + id: vale-version |
| 49 | + run: | |
| 50 | + VERSION=$(node -p "(require('./package.json').config && require('./package.json').config.valeVersion) || ''") |
| 51 | + echo "vale_version=$VERSION" >> $GITHUB_OUTPUT |
| 52 | + - name: Cache Vale binary |
| 53 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 54 | + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 |
| 55 | + with: |
| 56 | + path: node_modules/.cache/mui-vale |
| 57 | + key: ${{ runner.os }}-mui-vale-${{ steps.vale-version.outputs.vale_version }} |
| 58 | + - uses: vale-cli/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1 |
| 59 | + continue-on-error: true # GitHub Action flag needed until https://github.com/errata-ai/vale-action/issues/89 is fixed |
| 60 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 61 | + with: |
| 62 | + version: ${{ steps.vale-version.outputs.vale_version }} |
| 63 | + # Errors should be more visible |
| 64 | + fail_on_error: true |
| 65 | + # The other reports don't work, not really https://github.com/reviewdog/reviewdog#reporters |
| 66 | + reporter: github-pr-check |
| 67 | + # Required, set by GitHub actions automatically: |
| 68 | + # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret |
| 69 | + token: ${{secrets.GITHUB_TOKEN}} |
0 commit comments