Support publish workflow when ignore option is set#245
Open
augustjk wants to merge 1 commit intochangesets:mainfrom
Open
Support publish workflow when ignore option is set#245augustjk wants to merge 1 commit intochangesets:mainfrom
augustjk wants to merge 1 commit intochangesets:mainfrom
Conversation
|
8 tasks
Member
|
This PR is a little old now, going to try and review / revive it to see if the fix is still valid. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #241
The current implementation of using
readChangesetState()on entry is based on@changesets/readwhich simply reads all of the markdown files in.changesetdirectory.Trigging the action while using the
ignoreoption with changeset files present for both ignored and non-ignored packages, theversionwill run and consume changesets made for non-ignored packages, but leave those of ignored packages. When the PR is merged and the action is run again in this state, instead of moving on to thepublishflow, it still enters theversionflow and tries to make a PR, which fails as there are no releasable packages in this state.The fix incorporates
@changesets/get-release-planwhich actually returns a list ofreleaseswhich takes into account the ignored packages config. The flow control now utilizes this list to determine whether there's anything to version or publish.I've done some testing of this change at https://github.com/augustjk/changesets-test-project/actions and confirmed publishing with ignored packages works.
Open questions:
hasReleasesfor the control to better reflect this, and added to the output. ThehasChangesetsvariable and output no longer really serve a purpose within the code. I've left it here so as not to break users currently using this output as advertised on the README. Is this acceptable?releasesinstead ofchangesetsmight have some other consequences that I'm not thinking of.