* Update filesize badges (might need further evolution before 2.0.0) * Don't run full CI/CD when only .md docs have changed in the PR - move eslint checks into their own file so they can also ignore .md changes - prettier checks don't need the same perms as eslint, so we can demote pull_request_target -> pull_request * Add empty changeset * Implement the bundle size change originally originally added in #1784 - adding here also to show how the conflicts would resolve * Update .github/workflows/eslint-check.yml --------- Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
59 lines
1.9 KiB
YAML
59 lines
1.9 KiB
YAML
name: Prettier Check
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
prettier_check:
|
|
# In the forked PR, it's hard to format code and push to the branch directly, so the action only check the format correctness.
|
|
if: github.event_name != 'push' && github.event.pull_request.head.repo.full_name != 'rrweb-io/rrweb'
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-latest
|
|
name: Format Check
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
ref: ${{ github.head_ref }}
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: lts/*
|
|
cache: 'yarn'
|
|
- name: Install Dependencies
|
|
run: yarn install --frozen-lockfile
|
|
env:
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
|
- name: Prettier Check
|
|
run: yarn prettier --check '**/*.{ts,md}'
|
|
|
|
prettier:
|
|
# Skip the format code action in forked PRs
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'rrweb-io/rrweb'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
name: Format Code
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
ref: ${{ github.head_ref }}
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: lts/*
|
|
cache: 'yarn'
|
|
- name: Install Dependencies
|
|
run: yarn install --frozen-lockfile
|
|
env:
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
|
- name: Prettify Code
|
|
run: yarn prettier --write '**/*.{ts,md}'
|
|
- name: Commit Changes
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
commit_message: Apply formatting changes
|
|
branch: ${{ github.head_ref }}
|
|
file_pattern: ':!packages/rrweb-player/.svelte-kit/ambient.d.ts'
|