From bc042f3505062649a65a066f479171d08870e278 Mon Sep 17 00:00:00 2001 From: sorinvoicu <61691256+sorinvoicu@users.noreply.github.com> Date: Wed, 13 Mar 2024 21:01:51 +0000 Subject: [PATCH] change check workflow --- .github/workflows/check.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 07c50a0..b1d0006 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -14,6 +14,12 @@ on: branches: - main workflow_call: + inputs: + dep_path: + description: Path of the dependency file. + required: false + type: string + default: "dependencies.yml" concurrency: group: check-test-${{ github.event.pull_request.number || github.ref }} @@ -30,17 +36,23 @@ jobs: - name: Checkout project ⬇️ uses: actions/checkout@v4 + - name: Normalize variables 📏 + run: | + package_subdirectory_input="${{ inputs.dep_path }}" + echo "dep_path=${dep_path:-'dependencies.yml'}" >> $GITHUB_ENV + shell: bash + - name: Install package dependencies 📄 run: | - if (file.exists("dependencies.yml")) { - repos <- yaml::yaml.load(readLines("dependencies.yml"))$dependencies |> + if (file.exists(${{ env.dep_path }})) { + repos <- yaml::yaml.load(readLines(${{ env.dep_path }}))$dependencies |> sapply(function(x) x$repo) if(repos |> length() > 0) { repos |> pak::pak(dependencies = TRUE, ask = FALSE, upgrade = FALSE) } } - shell: Rscript {0} + shell: Rscript {0} - name: Check 📦 run: |