Skip to content

upd: new lint for updated files #15

upd: new lint for updated files

upd: new lint for updated files #15

Workflow file for this run

name: ESLint Check
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
lint:
runs-on: ubuntu-latest
steps:

Check failure on line 12 in .github/workflows/1_lint.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/1_lint.yml

Invalid workflow file

You have an error in your yaml syntax on line 12
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: |
yarn add eslint eslint-plugin-astro @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-prettier astro-eslint-parser --dev
# - name: Run ESLint
# run: |
# export NODE_OPTIONS=--max-old-space-size=16384
# yarn lint --max-warnings 0
# timeout-minutes: 60
- name: Get list of changed files
id: changed-files
run: |
git diff --name-only ${{ github.event.before }} ${{ github.sha }} > changed_files.txt
- name: Run ESLint on changed files
run: |
export NODE_OPTIONS=--max-old-space-size=32768
CHANGED_FILES=$(cat changed_files.txt | grep -E '\.(ts|tsx|astro)$' | tr '\n' ' ')
if [ -n "$CHANGED_FILES" ]; then
yarn eslint $CHANGED_FILES --cache --max-warnings 0
else
echo "No TypeScript or Astro files changed."
fi
timeout-minutes: 60