mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-12 15:21:08 +00:00
61378559ca
- sharp 0.35.5 (librsvg CVE), with the musl pins that ship in the image. - follow-redirects 1.16.2, postcss-selector-parser 6.1.5 and serialize-javascript 7.1.3, from the open advisories. - GitHub Actions: github-script 9 and the minor-and-patch group. - plugin-sdk: @types/update-notifier 6.0.9. The grouped npm update is left out: with it the server build runs out of memory in tsc, and the culprit is not found yet.
64 lines
2.0 KiB
YAML
64 lines
2.0 KiB
YAML
name: Lint & Prettier
|
|
on:
|
|
pull_request:
|
|
branches: [main, dev]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 45
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: .nvmrc
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Run lint & format check
|
|
# Both are check-only: lint used to run eslint --fix, which rewrote the
|
|
# files before format:check looked at them, so neither could fail on
|
|
# formatting. lint:format holds every file outside
|
|
# scripts/format-baseline.json to Prettier; the list only shrinks.
|
|
id: checks
|
|
continue-on-error: true
|
|
run: |
|
|
cd shared
|
|
npm run lint
|
|
npm run lint:format
|
|
|
|
- name: Comment on PR if checks failed
|
|
if: steps.checks.outcome == 'failure'
|
|
uses: actions/github-script@v9
|
|
with:
|
|
script: |
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
body: [
|
|
'## ❌ Lint & Prettier check failed',
|
|
'',
|
|
'Please fix the issues locally by running the following commands inside the `shared` package:',
|
|
'',
|
|
'```bash',
|
|
'cd shared',
|
|
'npm run lint:fix',
|
|
'npx prettier --write <file> # each file lint:format names',
|
|
'npm run lint:format -- --update # when a listed file is formatted now',
|
|
'```',
|
|
'',
|
|
'Then commit and push the changes.',
|
|
].join('\n'),
|
|
});
|
|
|
|
- name: Fail the job if checks failed
|
|
if: steps.checks.outcome == 'failure'
|
|
run: exit 1 |