mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: reviewdog
|
|
|
|
on: [pull_request_target]
|
|
|
|
env:
|
|
NODE_VERSION: "22.x"
|
|
|
|
jobs:
|
|
eslint:
|
|
name: runner / eslint
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
checks: write
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
run_install: false
|
|
|
|
- name: Setup NodeJS
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- id: files
|
|
uses: Ana06/get-changed-files@v2.3.0
|
|
- name: Get changed JS files
|
|
run: |
|
|
matching_files=()
|
|
for changed_file in ${{ steps.files.outputs.added_modified }}; do
|
|
if [[ "$changed_file" =~ \.(js|jsx|ts|tsx)$ ]]; then
|
|
matching_files+=("$changed_file")
|
|
fi
|
|
done
|
|
# Set env var to be used in next step
|
|
echo "CHANGED_JS_FILES=${matching_files[@]}" >> $GITHUB_ENV
|
|
|
|
- uses: reviewdog/action-eslint@v1.34.0
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
reporter: github-pr-review # Change reporter.
|
|
eslint_flags: "${{ env.CHANGED_JS_FILES }}"
|
|
fail_level: error
|
|
filter_mode: nofilter
|