From f3fc1b87ad133b35bec63c0f2a0f8fd2e19c6f6b Mon Sep 17 00:00:00 2001 From: Masaya Suzuki <15100604+massongit@users.noreply.github.com> Date: Sat, 23 Sep 2023 23:30:23 +0900 Subject: [PATCH] =?UTF-8?q?super-linter=E3=81=AB=E4=B8=8E=E3=81=88?= =?UTF-8?q?=E3=82=8BPATH=E3=82=92=E5=85=83=E3=80=85=E3=81=AEPATH=E3=82=92?= =?UTF-8?q?=E5=85=83=E3=81=AB=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=20(#1372?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/super-linter.yml | 3 +-- scripts/super_linter/build/set_path.sh | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 scripts/super_linter/build/set_path.sh diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index 6fb6b98eb..037a07a70 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -43,7 +43,7 @@ jobs: - uses: actions/setup-node@v3.8.1 with: cache: npm - - run: npm ci --prefer-offline + - run: bash "${GITHUB_WORKSPACE}/scripts/super_linter/build/set_path.sh" ################################ # Run Linter against code base # ################################ @@ -52,7 +52,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LINTER_RULES_PATH: . - PATH: /github/workspace/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/node_modules/.bin:/venvs/ansible-lint/bin:/venvs/black/bin:/venvs/cfn-lint/bin:/venvs/cpplint/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/mypy/bin:/venvs/pylint/bin:/venvs/snakefmt/bin:/venvs/snakemake/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin:/venvs/yq/bin:/var/cache/dotnet/tools:/usr/share/dotnet concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true diff --git a/scripts/super_linter/build/set_path.sh b/scripts/super_linter/build/set_path.sh new file mode 100644 index 000000000..6ab85933b --- /dev/null +++ b/scripts/super_linter/build/set_path.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +npm ci --prefer-offline +action="$(yq '.jobs.build.steps[-1].uses' .github/workflows/super-linter.yml)" +PATH="$(docker run --rm --entrypoint '' "ghcr.io/${action//\/slim@/:slim-}" /bin/sh -c 'echo $PATH')" +echo "PATH=/github/workspace/node_modules/.bin:${PATH}" >> "$GITHUB_ENV"