apply form ux fixes #65
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: Code Quality Scoring | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - 'src/**.ts' | |
| - 'src/**.tsx' | |
| - '.github/scripts/**' | |
| - '.eslintrc*' | |
| - 'package.json' | |
| - 'tsconfig.json' | |
| jobs: | |
| score-code-quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run ESLint and generate report | |
| run: npx eslint src --ext .ts,.tsx -f json -o eslint-report.json || true | |
| - name: Score the code | |
| run: node .github/scripts/scoreCode.js | |
| - name: Comment Code Score on PR | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const body = fs.readFileSync('score-output.md', 'utf8'); | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body | |
| }); |