From 74884bcdd92e5ebb43d81be6befa4e945535c340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Varga?= Date: Wed, 15 May 2024 10:38:54 +0200 Subject: [PATCH] ci: Improve build.yml - Change fetch-depth to 0 in release job - Release job enabled only on the default branch - Kover skipped on fork PRs --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4569c86..6b886ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,9 +70,11 @@ jobs: contents: write needs: - build - if: github.event_name == 'workflow_dispatch' && github.event.inputs.releaseVersion != '' && !endsWith(github.event.inputs.releaseVersion, 'SNAPSHOT') + if: github.ref_name == github.event.repository.default_branch && github.event_name == 'workflow_dispatch' && github.event.inputs.releaseVersion != '' && !endsWith(github.event.inputs.releaseVersion, 'SNAPSHOT') steps: - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 + with: + fetch-depth: 0 - name: Create release shell: bash run: | @@ -92,7 +94,7 @@ jobs: checks: write contents: read pull-requests: write - if: github.event_name == 'pull_request' + if: github.repository == 'apter-tech/junit5-robolectric-extension' && github.event_name == 'pull_request' steps: - name: Download coverage report uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7