From 99229f978c4162c6d303bc4844b0ff513256f7d6 Mon Sep 17 00:00:00 2001 From: Felix Riegger Date: Tue, 2 May 2023 21:49:27 +0200 Subject: [PATCH] Fix EISDIR error due to globbed directories (#1) (#132) --- .github/workflows/globbed-directories.yml | 23 +++++++++++++++++++++++ src/config.ts | 1 + 2 files changed, 24 insertions(+) create mode 100644 .github/workflows/globbed-directories.yml diff --git a/.github/workflows/globbed-directories.yml b/.github/workflows/globbed-directories.yml new file mode 100644 index 0000000..3d37b67 --- /dev/null +++ b/.github/workflows/globbed-directories.yml @@ -0,0 +1,23 @@ +name: globbed-directories + +on: [push, pull_request] + +jobs: + simple: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + + name: Test `cargo check/test` on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + env: + CARGO_TERM_COLOR: always + + steps: + - uses: actions/checkout@v3 + - name: Create folder that will be globbed + run: | + mkdir -p folder/rust-toolchain + - uses: ./ diff --git a/src/config.ts b/src/config.ts index 77f6965..4164037 100644 --- a/src/config.ts +++ b/src/config.ts @@ -141,6 +141,7 @@ export class CacheConfig { )), ); } + keyFiles = keyFiles.filter(file => !fs.statSync(file).isDirectory()); keyFiles.sort((a, b) => a.localeCompare(b)); hasher = crypto.createHash("sha1");