From 7efd158e737edf3dd2c10d75bfd54833478602d8 Mon Sep 17 00:00:00 2001 From: Dominik Date: Sat, 23 Dec 2023 02:10:59 +0100 Subject: [PATCH] avoid doubled checkout Signed-off-by: Dominik --- .github/workflows/build_and_test.yaml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 07278f965b..fdbfd60a9b 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -55,22 +55,13 @@ jobs: restore-keys: | compile-${{ env.branch_name_for_cache }}- compile- - - name: Checkout from `everest-core` the `.ci/` directory (reusable workflow mode, see https://stackoverflow.com/a/74123003/1168315) + - name: Checkout `everest-core` (to only get the `.ci/` directory if reusable workflow mode, see https://stackoverflow.com/a/74123003/1168315) uses: actions/checkout@v4 with: - sparse-checkout: | - .ci repository: EVerest/everest-core ref: CI/reusable-workflow # TODO get reference in general, see https://stackoverflow.com/questions/74784735 resp. https://github.com/actions/toolkit/issues/1264 - - name: Move `.ci/` to `/tmp` and remove `everest-core` - run: | - mv .ci /tmp - pwd && ls -hal . - cd .. - pwd && ls -hal . - rm -rf everest-core - pwd && ls -hal . - - name: Checkout repo ${{ inputs.repository || 'EVerest/everest-core' }} + - name: Checkout repo ${{ inputs.repository }} + if: ${{ github.repository != EVerest/everest-core }} uses: actions/checkout@v4 with: repository: ${{ inputs.repository }}