Skip to content

chore: add auto lint fixing #1

chore: add auto lint fixing

chore: add auto lint fixing #1

Workflow file for this run

name: Lint
on:
pull_request:
branches: main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
lint-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-all-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-all-
- name: Install deps (with cache)
run: pnpm install --child-concurrency 3
- name: Run ESLint
run: pnpm turbo --filter="@trpc/*" lint -- fix
- name: Commit changes
run: |
git config --global user.email "<>"
git config --global user.name "trpc-bot"
git add .
git commit -m "chore: lint fix"
git push
other-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-all-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-all-
- name: Install deps (with cache)
run: pnpm install --child-concurrency 3
- name: Run ts-prune
run: pnpm lint-prune
- name: Run Manypkg
run: pnpm manypkg fix
- name: Run Prettier
run: pnpm format --write
lint-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-all-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-all-
- name: Install deps (with cache)
run: pnpm install --child-concurrency 3
- name: Run ESLint
run: pnpm turbo --filter="@examples/*" lint -- --fix
- name: Commit changes
run: |
git config --global user.email "<>"
git config --global user.name "trpc-bot"
git add .
git commit -m "chore: lint fix"
git push