changesets/action

fix: trying to publish when not needed

jjangga0214 opened this issue · 1 comments

      - name: Create Release PR or Publish
        uses: changesets/action@v1
        id: changesets
        with:
          commit: 'chore: release'
          title: 'chore: release'
          version: pnpm changeset version
          publish: 'pnpm -r publish && changeset tag && git push --follow-tags'
          createGithubReleases: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

It executes publish when it should not.

스크린샷 2023-06-08 오후 6 39 09

Currently in my repo, as the printed messages suggest, there's no changeset and nothing new to release.
So it should not publish, but it tries running the command 'pnpm -r publish && changeset tag && git push --follow-tags' which I set as publish option.

According to the docs: https://github.com/changesets/changesets/blob/main/docs/automating-changesets.md#blocking
Basically you can add a step that run this command:

changeset status --since=main

This will exit with exit code 1 if there have been no new changesets since main.