Update eslint monorepo to v9.38.0 (minor) #170
Workflow file for this run
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: Comment lint results on PR | |
| if: ${{ !cancelled() }} | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const output = fs.readFileSync('lint-output.txt', 'utf8'); | |
| const exitCode = '${{ steps.lint.outputs.exit_code }}'; | |
| const title = exitCode === '0' ? '✅ Lint passed' : '❌ Lint found issues'; | |
| const marker = '<!-- lint-report:adev-nextjs-blog -->'; | |
| const body = `${marker}\n### ${title}\n\n<details><summary>Show output</summary>\n\n\`\`\`\n${output.slice(-60000)}\n\`\`\`\n\n</details>`; | |
| const { owner, repo } = context.repo; | |
| const issue_number = context.issue.number; | |
| if (!issue_number) { | |
| core.info('No pull request context detected, skipping comment.'); | |
| } else { | |
| // Find existing comment with the marker and update it; otherwise create a new one | |
| const comments = await github.paginate(github.rest.issues.listComments, { | |
| owner, | |
| repo, | |
| issue_number, | |
| per_page: 100, | |
| }); | |
| const existing = comments.find(c => typeof c.body === 'string' && c.body.includes(marker)); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body }); | |
| } else { | |
| await github.rest.issues.createComment({ owner, repo, issue_number, body }); | |
| } | |
| } | |
| - 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 --no-lint | |
| env: | |
| SKIP_T3_ENV_VALIDATION: 'true' |