Skip to content

Commit

Permalink
Ignore specific branches in ESLint workflow and simplify yarn commands (
Browse files Browse the repository at this point in the history
  • Loading branch information
guidomodarelli authored Dec 11, 2024
1 parent fab9456 commit af71101
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ name: ESLint

on:
pull_request:
branches-ignore:
- 2.*
- 3.*
- 4.*

jobs:
linter:
Expand Down Expand Up @@ -39,12 +43,11 @@ jobs:
echo "Listing branches"
git branch -a
echo "Getting diff files ignoring deleted and getting the changed or renamed files"
CHANGED_FILES=$(git diff --name-status --diff-filter d ${REMOTE_NAME}/${GITHUB_BASE_REF}..${REMOTE_NAME}/${GITHUB_HEAD_REF} | awk '{print $2}')
CHANGED_FILES=$(git diff --name-status --diff-filter d ${REMOTE_NAME}/${GITHUB_BASE_REF}..${REMOTE_NAME}/${GITHUB_HEAD_REF} | awk '{print $NF}' | grep -E '.*\.[jt]sx?$')
echo "Changed files:"
echo "${CHANGED_FILES}"
git checkout $GITHUB_HEAD_REF
plugin_package_json=$(ls -d plugins/* | head -n1)
echo "Installing dependencies from plugin: ${plugin_package_json}"
yarn --cwd "${plugin_package_json}" --modules-folder ../../node_modules
echo "Installing dependencies"
yarn
echo "Running eslint on the changed files"
npx eslint ${CHANGED_FILES}

0 comments on commit af71101

Please sign in to comment.