Update oxlint monorepo (minor) #197
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: Lint | |
| on: | |
| pull_request: | |
| types: [ opened, synchronize, reopened ] | |
| permissions: { } | |
| env: | |
| CI: 'true' | |
| DO_NOT_TRACK: '1' | |
| NEXT_TELEMETRY_DISABLED: '1' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| lint: | |
| name: Lint app | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 | |
| with: | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6 | |
| with: | |
| node-version-file: .node-version | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - uses: oxc-project/oxlint-action@d77e44ee001f4d94c4191fdb03af8be0c98f3d35 # v2.0.1 | |
| with: | |
| config: .oxlintrc.json | |
| - name: Run lint and capture output | |
| id: lint | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| pnpm run lint 2>&1 | tee lint-output.txt | |
| echo "exit_code=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT | |
| continue-on-error: true | |
| - name: Build markdown report | |
| id: report | |
| shell: bash | |
| run: | | |
| TITLE=$([ "${{ steps.lint.outputs.exit_code }}" = "0" ] && echo "✅ Lint passed" || echo "❌ Lint found issues") | |
| { | |
| echo "### ${TITLE}" | |
| echo | |
| echo "<details><summary>Show output</summary>" | |
| echo | |
| echo '```' | |
| tail -c 60000 lint-output.txt || true | |
| echo '```' | |
| echo | |
| echo "</details>" | |
| } > lint-report.md | |
| - name: Comment lint results on PR | |
| if: ${{ !cancelled() }} | |
| uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4 | |
| with: | |
| header: lint-report:adev-nextjs-blog | |
| path: lint-report.md | |
| - name: Fail if lint failed | |
| if: steps.lint.outputs.exit_code != '0' && !cancelled() | |
| run: exit ${{ steps.lint.outputs.exit_code }} | |
| - name: Build | |
| run: pnpm run build | |
| env: | |
| SKIP_T3_ENV_VALIDATION: 'true' |