From d562f6a69f4dc7c0538065b34530f757e7f3acc9 Mon Sep 17 00:00:00 2001 From: mikiher Date: Sun, 17 Mar 2024 07:36:13 +0200 Subject: [PATCH 1/2] 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 From f938fca2c701ee26e0843a3a8a9eeb5158109828 Mon Sep 17 00:00:00 2001 From: mikiher Date: Sun, 17 Mar 2024 07:57:28 +0200 Subject: [PATCH 2/2] Fix bug in workflow_dispatch checkout step --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 80b9855d..695696c6 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -22,7 +22,7 @@ jobs: - name: Checkout (workflow_dispatch) uses: actions/checkout@v4 with: - ref: inputs.ref + ref: ${{ inputs.ref }} if: github.event_name == 'workflow_dispatch' - name: Set up Node.js