From 084493712c226f6c795596ca2fb480cfe577c04f Mon Sep 17 00:00:00 2001 From: Jonas Amundsen Date: Sat, 10 Jun 2023 09:58:41 +0200 Subject: [PATCH] Utilize newly introduced [1] sparse-checkout option I am admittedly a little unsure why files in leading directories, including the root directory, aren't included. I feel like, based on how I read the docs, that they should be included, but I'm glad that they're not. [1] https://github.com/actions/checkout/pull/1369 --- .github/workflows/examples-branch.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/examples-branch.yml b/.github/workflows/examples-branch.yml index be41779b..39109239 100644 --- a/.github/workflows/examples-branch.yml +++ b/.github/workflows/examples-branch.yml @@ -78,7 +78,13 @@ jobs: apt-get update apt-get install -y --no-install-recommends ca-certificates - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v3.5.3 + with: + sparse-checkout: examples/${{ matrix.example }} + - name: Sparse checkout sanity check + run: | + [ ! -f package.json ] + [ ! -f package-lock.json ] - name: Cache NPM modules uses: actions/cache@v3 with: @@ -89,12 +95,6 @@ jobs: with: path: ~/.cache/Cypress key: cypress-examples - # In lack of native support, https://github.com/actions/checkout/issues/172. - - name: Make checkout sparse - run: | - shopt -s extglob - rm -rf examples/!(${{ matrix.example }}) - rm -rf !(examples) - name: Retrieve dirty build uses: actions/download-artifact@v3 with: