Skip to content

Commit

Permalink
Fix further stuff related to GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Dec 6, 2023
1 parent df3fc53 commit b41e342
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/actions/changed_files/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ runs:
shell: bash
id: get-changed-files
run: |
files_pretty=$(git diff --name-only --diff-filter=ACMR -r HEAD^1...HEAD | grep '${{inputs.file-extensions}}' || test $? = 1;)
files_pretty=$(git diff --name-only --diff-filter=ACMR -r HEAD^1...HEAD | grep -e '${{inputs.file-extensions}}' || test $? = 1;)
printf "🎴 Changed files: \n$files_pretty"
echo "files=$(echo ${files_pretty} | xargs)" >> $GITHUB_ENV
echo "files=$(echo ${files_pretty} | xargs)" >> $GITHUB_OUTPUT
19 changes: 12 additions & 7 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,32 @@ jobs:
name: ESLint (JS)
runs-on: ubuntu-latest
steps:
- name: Checkout custom reusable actions
uses: actions/checkout@v4 # used to checkout custom reusable actions
with:
fetch-depth: 2 # to also fetch parent of PR
# - name: Checkout custom reusable actions
# uses: actions/checkout@v4 # used to checkout custom reusable actions
# with:
# fetch-depth: 2 # to also fetch parent of PR

- name: Checkout code & get changed files
id: eslint-changed
uses: ./.github/actions/changed_files/
with:
file-extensions: \.js$|\.js.erb$

- name: Trial and error
if: ${{ steps.eslint-changed.outputs.changed-files != ''}}
run: 'echo "Changed files: aa${{ steps.eslint-changed.outputs.changed-files }}bb"'

- name: Setup Node.js
if: ${{ steps.eslint-changed.outputs.changed-files }} != ''
if: ${{ steps.eslint-changed.outputs.changed-files != ''}}
uses: actions/setup-node@v4
with:
node-version: '20' # End of Life (EOL): April 2026

- name: Install dependencies
if: ${{ steps.eslint-changed.outputs.changed-files }} != ''
if: ${{ steps.eslint-changed.outputs.changed-files != ''}}
run: yarn install

- name: Run ESLint
if: ${{ steps.eslint-changed.outputs.changed-files }} != ''
if: ${{ steps.eslint-changed.outputs.changed-files != ''}}
run: yarn run eslint --ignore-path .gitignore --max-warnings 0 ${{ steps.eslint-changed.outputs.changed-files }}

0 comments on commit b41e342

Please sign in to comment.