From b41e342fa62af97ed9f3dd3a017a926a31987a4f Mon Sep 17 00:00:00 2001 From: Splines Date: Wed, 6 Dec 2023 18:10:40 +0100 Subject: [PATCH] Fix further stuff related to GitHub action --- .github/actions/changed_files/action.yml | 4 ++-- .github/workflows/linter.yml | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/actions/changed_files/action.yml b/.github/actions/changed_files/action.yml index f2fc336b3..151273090 100644 --- a/.github/actions/changed_files/action.yml +++ b/.github/actions/changed_files/action.yml @@ -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 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 5145bd761..470ad3fe3 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -48,10 +48,10 @@ 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 @@ -59,16 +59,21 @@ jobs: 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 }} + \ No newline at end of file