ci: harden workflow defaults

This commit is contained in:
Your Name 2026-05-27 12:00:40 +08:00
parent 499fceb689
commit 8e9669c748
2 changed files with 17 additions and 2 deletions

View File

@ -4,9 +4,17 @@ on:
push: push:
pull_request: pull_request:
permissions:
contents: read
concurrency:
group: quality-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
quality: quality:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 20
strategy: strategy:
matrix: matrix:
node-version: [20] node-version: [20]

View File

@ -5,10 +5,17 @@ on:
pull_request: pull_request:
branches: [main, master] branches: [main, master]
permissions:
contents: read
concurrency:
group: playwright-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
test: test:
timeout-minutes: 30 timeout-minutes: 30
runs-on: ubuntu-latest runs-on: ubuntu-22.04
if: >- if: >-
github.event_name == 'push' || github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository github.event.pull_request.head.repo.full_name == github.repository
@ -38,7 +45,7 @@ jobs:
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: Cache Playwright browsers - name: Cache Playwright browsers
uses: actions/cache@v3 uses: actions/cache@v4
id: playwright-cache id: playwright-cache
with: with:
path: ~/.cache/ms-playwright path: ~/.cache/ms-playwright