From 85f658438e855d6145d2c2574ce365f14c074982 Mon Sep 17 00:00:00 2001 From: Bruno Borges Date: Wed, 15 Jul 2026 10:59:21 -0400 Subject: [PATCH] Address review: argc guard in check-dir.sh, fix sbt ubuntu matrix conditionals - check-dir.sh: with set -u, invoking without a argument failed with an opaque "parameter not set" error. Add an explicit argc check that prints a usage message and exits 2 (distinct from the assertion failure code 1). - e2e-cache.yml: the sbt-save and sbt-restore jobs run on an ubuntu-22.04 matrix entry, but their coursier-cache steps were guarded by 'if: matrix.os == "ubuntu-latest"', so those checks never executed on Ubuntu. Align the conditionals with the matrix (ubuntu-22.04), matching the newer sbt1/sbt2 jobs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/e2e-cache.yml | 4 ++-- __tests__/check-dir.sh | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index 1601de11..07a1c644 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -144,7 +144,7 @@ jobs: if: matrix.os == 'windows-latest' run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache" - name: Check files to cache on ubuntu-latest - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-22.04' run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier" sbt-restore: runs-on: ${{ matrix.os }} @@ -177,7 +177,7 @@ jobs: if: matrix.os == 'windows-latest' run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache" - name: Confirm that ~/.cache/coursier directory has been made - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-22.04' run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier" gradle1-save: runs-on: ${{ matrix.os }} diff --git a/__tests__/check-dir.sh b/__tests__/check-dir.sh index 9e2f3276..30da05fd 100755 --- a/__tests__/check-dir.sh +++ b/__tests__/check-dir.sh @@ -10,6 +10,11 @@ # tilde-expansion pitfalls. set -eu +if [ "$#" -lt 1 ]; then + echo "Usage: check-dir.sh [present|absent]" >&2 + exit 2 +fi + dir=$1 mode=${2:-present}