mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-11-06 16:21:06 +00:00
CodeQL actions/missing-workflow-permissions #1-#3: neither workflow writes through GITHUB_TOKEN (checkout, toolchain, cache, upload-artifact).
59 lines
1.2 KiB
YAML
59 lines
1.2 KiB
YAML
name: Frontend CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
paths:
|
|
- 'frontend/**'
|
|
- '.github/workflows/frontend-ci.yml'
|
|
pull_request:
|
|
branches: [main, master]
|
|
paths:
|
|
- 'frontend/**'
|
|
- '.github/workflows/frontend-ci.yml'
|
|
workflow_dispatch:
|
|
|
|
|
|
# Read-only token: no step writes through GITHUB_TOKEN.
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint-and-test:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: frontend
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: frontend/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Prettier check
|
|
run: npm run pretty:check
|
|
|
|
- name: Run tests
|
|
run: npm run test -- --passWithNoTests
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: frontend-build
|
|
path: frontend/build/
|
|
retention-days: 7
|