diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9c7cd4d..9f03da8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,7 +53,12 @@ jobs: npm test check_if_version_upgraded: name: Check if version upgrade - if: github.event_name == 'push' + # We run this only if it's a push on the default branch or if it's a PR from a + # branch (meaning not a PR from a fork). It would be more straightforward to test if secrets.NPM_TOKEN is + # defined but GitHub Action don't allow it yet. + if: | + github.event_name == 'push' || + github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login runs-on: ubuntu-latest needs: test outputs: @@ -103,7 +108,7 @@ jobs: target_commitish: ${{ github.ref }} body: ${{ steps.step1.outputs.body }} draft: false - prerelease: false + prerelease: ${{ needs.check_if_version_upgraded.outputs.to_version.is_release_beta == 'true' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}