Skip to content

Commit

Permalink
ci: Improve build.yml
Browse files Browse the repository at this point in the history
- Change fetch-depth to 0 in release job
- Release job enabled only on the default branch
- Kover skipped on fork PRs
  • Loading branch information
warnyul committed May 15, 2024
1 parent 9fffee5 commit 74884bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand Down

0 comments on commit 74884bc

Please sign in to comment.