From d562f6a69f4dc7c0538065b34530f757e7f3acc9 Mon Sep 17 00:00:00 2001 From: mikiher Date: Sun, 17 Mar 2024 07:36:13 +0200 Subject: [PATCH] Change unit-tests.yml workflow to include conditional checkout step --- .github/workflows/unit-tests.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 24f6398c..80b9855d 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -11,13 +11,19 @@ on: jobs: run-unit-tests: + name: Run Unit Tests runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout (push/pull request) + uses: actions/checkout@v4 + if: github.event_name != 'workflow_dispatch' + + - name: Checkout (workflow_dispatch) uses: actions/checkout@v4 with: - ref: ${{ github.event_name != 'workflow_dispatch' && github.ref_name || inputs.ref}} + ref: inputs.ref + if: github.event_name == 'workflow_dispatch' - name: Set up Node.js uses: actions/setup-node@v4