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