fix: Dependency updates #6
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: CI | |
| on: | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| pr-title: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| steps: | |
| - uses: amannn/action-semantic-pull-request@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| types: | | |
| feat | |
| fix | |
| perf | |
| refactor | |
| docs | |
| test | |
| ci | |
| chore | |
| build | |
| style | |
| revert | |
| requireScope: false | |
| validation: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| filter: tree:0 | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10.33.0 | |
| run_install: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| env: | |
| HUSKY: 0 | |
| - run: pnpm typecheck | |
| - run: pnpm lint | |
| - run: pnpm build | |
| - name: Generate coverage summary | |
| id: coverage | |
| run: pnpm coverage:summary | |
| continue-on-error: true | |
| - name: Publish coverage summary to Checks UI | |
| if: steps.coverage.outcome == 'success' || steps.coverage.outcome == 'failure' | |
| run: | | |
| { | |
| echo "# Coverage check" | |
| echo | |
| if [ "${{ steps.coverage.outcome }}" = "success" ]; then | |
| echo "Result: passed" | |
| else | |
| echo "Result: failed" | |
| fi | |
| echo | |
| cat .coverage-reports/summary.md | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload coverage report artifacts | |
| if: steps.coverage.outcome == 'success' || steps.coverage.outcome == 'failure' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-summary | |
| path: .coverage-reports | |
| - name: Post coverage summary as PR comment | |
| if: steps.coverage.outcome == 'success' || steps.coverage.outcome == 'failure' | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const outcome = '${{ steps.coverage.outcome }}'; | |
| const status = outcome === 'success' ? '✅ passed' : '❌ failed'; | |
| let body = `## Coverage check\n\nResult: ${status}\n`; | |
| try { | |
| body += '\n' + fs.readFileSync('.coverage-reports/summary.md', 'utf8'); | |
| } catch { | |
| body += '\n_(Coverage report not available.)_'; | |
| } | |
| const marker = '<!-- coverage-summary -->'; | |
| body = marker + '\n' + body; | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const existing = comments.find(c => c.body.includes(marker)); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body, | |
| }); | |
| } | |
| - name: Enforce coverage summary status | |
| if: steps.coverage.outcome == 'failure' | |
| run: exit 1 |