Skip to content

Add select-mode, version, pack and publish sub-actions - #656

Merged
bluwy merged 12 commits into
mainfrom
new-version-publish-subaction
Jun 23, 2026
Merged

Add select-mode, version, pack and publish sub-actions#656
bluwy merged 12 commits into
mainfrom
new-version-publish-subaction

Conversation

@bluwy

Copy link
Copy Markdown
Member

Adds a very simple implementation of /select-mode, /version, and /publish sub-actions that reuses functions from the root action. I renamed some of the inputs, copied most of the logic over. There's probably more cleanup possible but I don't want to stray too far for now.

I also did not write any readme/docs as I'm lazy maybe it changes after the publish-plan PRs.

I made this PR mainly so we can make updates on it easier later, but I'm also fine closing this as starting from scratch with the publish-plan stuff if that's easier.

@changeset-bot

changeset-botBot commented Jun 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1c57c8c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@changesets/actionMinor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment threadversion/action.yml Outdated
Comment threadversion/action.yml Outdated
Comment threadsrc/version/index.ts Outdated
@Andarist
Andaristforce-pushed the new-version-publish-subaction branch from b6da0bd to 10ef577CompareJune 17, 2026 06:54
@AndaristAndarist changed the title Add select-mode, version, and publish sub-actionsAdd select-mode, version, pack and publish sub-actionsJun 20, 2026
Comment threadpublish/action.yml Outdated
Comment threadsrc/run.ts
});
};

if (script) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note how with a custom publish script we don't handle fromPackDir at all. My best idea to handle this would be to also add support for passing this argument~ through CLI args. That way the scripts could forward env to the underlying changesets publish kinda naturally - without messing with flags forwarding. Thoughts?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer not relying on envs as it can be sometimes hard to follow who set what at when. Maybe we can support some sort of interpolation? Like script: pnpm format && pnpm changeset publish $action_args or ... publish --from-pack-dir $action_from_pack_dir. Just need to make sure to prevent potential script injections.

OR do we even need to allow specifying a script now? Since the sub-actions are explicit invocations now, if they need a pre-command or post-command, just do it in a pre-post-step. If they need a different version/publishing scheme, then don't call our action.

But I think what you have now is also fine and then we extend it later.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OR do we even need to allow specifying a script now? Since the sub-actions are explicit invocations now, if they need a pre-command or post-command, just do it in a pre-post-step.

Yeah, I also wondered about that. Removing it would allow us to gather actual use cases for custom scripts before we re-commit to supporting them.

That said, it would break changesets/action's own publishing pipeline - or at least, it would make it more cumbersome~. But perhaps it wouldn't be too bad if only we'd expose changesets/action/github-release

@bluwybluwyJun 22, 2026

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For changesets/action, I think our publish script could be called directly like before without using the sub-action. For version though, I guess we need like a pre/post hook to make changes before we commit 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, we can stick to using the old root action - and figure this one later.

@socket-security

socket-securityBot commented Jun 22, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Added@​actions/​artifact@​6.2.19810010088100

View full report

Comment threadsrc/pack/index.ts Outdated
@Andarist
Andarist requested a review from beeequeueJune 22, 2026 12:42

@bluwybluwy left a comment

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bluwy
bluwy added this pull request to the merge queueJun 23, 2026
Merged via the queue into main with commit a12d90dJun 23, 2026
7 checks passed
@bluwy
bluwy deleted the new-version-publish-subaction branch June 23, 2026 06:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@bluwy@Andarist