Skip to content

Restrict publish job to the npm env#1972

Merged
Andarist merged 3 commits into
mainfrom
restrict-env
May 5, 2026
Merged

Restrict publish job to the npm env#1972
Andarist merged 3 commits into
mainfrom
restrict-env

Conversation

@Andarist

@Andarist Andarist commented May 5, 2026

Copy link
Copy Markdown
Member

No description provided.

@Andarist Andarist requested review from beeequeue, bluwy and emmatown May 5, 2026 08:26
@changeset-bot

changeset-bot Bot commented May 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dd6d251

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.85%. Comparing base (ff767d2) to head (dd6d251).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1972   +/-   ##
=======================================
  Coverage   83.85%   83.85%           
=======================================
  Files          56       56           
  Lines        2465     2465           
  Branches      743      748    +5     
=======================================
  Hits         2067     2067           
  Misses        392      392           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
name: Publish
if: needs.version.outputs.hasChangesets == 'false'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a little bit tricky. The previous job has 2 purposes:

  • mode selection (version vs publish)
  • eagerly executing the version mode

I think a cleaner design would be to introduce changesets/action/select-mode subaction - but that has to be implemented separately.

- name: Create Release Pull Request or Publish to npm
- name: Publish to npm
# https://github.com/changesets/action
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1

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.

why use the changesets action here it's effectively doing nothing, just do yarn release + probably pushing tags?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Primarily for dogfooding purposes. It also ends up being responsible for:

  • proper monorepo support
  • tagging
  • github releases

At the very least, the last thing can't be done inline as easily here.

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.

i think this is what we're going to want to do in the long run, let the PMs do the publishing the way they need to, then they can also handle their own special cases like workspaces, catalogs, etc.

as for right now, i would want to test running yarn publish or pnpm -r publish to see what it looks like before using it here

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.

Primarily for dogfooding purposes. It also ends up being responsible for:

  • proper monorepo support
  • tagging
  • github releases

right, it might be good to move that to the cli or something but makes sense.

as for right now, i would want to test running yarn publish or pnpm -r publish to see what it looks like before using it here

To be clear I wasn't talking about using yarn/pnpm publish, I still meant using changeset publish via the release package.json script we have, not yarn publish, I was just talking about the use of the action here.

@beeequeue beeequeue left a comment

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.

needs to be rebased to use pnpm and node --run

- name: Create Release Pull Request or Publish to npm
- name: Publish to npm
# https://github.com/changesets/action
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1

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.

i think this is what we're going to want to do in the long run, let the PMs do the publishing the way they need to, then they can also handle their own special cases like workspaces, catalogs, etc.

as for right now, i would want to test running yarn publish or pnpm -r publish to see what it looks like before using it here

@Andarist

Andarist commented May 5, 2026

Copy link
Copy Markdown
Member Author

@beeequeue this targets the main branch so node --run shouldn't be used here (yet), right?

@beeequeue

Copy link
Copy Markdown
Member

oh, my bad

@Andarist Andarist merged commit 7af5876 into main May 5, 2026
8 checks passed
@Andarist Andarist deleted the restrict-env branch May 5, 2026 10:52
Sign up for free to 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.

3 participants