Skip to content

chore(github): add pkg.pr.new preview publishing#495

Merged
benjamincanac merged 2 commits into
mainfrom
ci/pkg-pr-new
Jun 2, 2026
Merged

chore(github): add pkg.pr.new preview publishing#495
benjamincanac merged 2 commits into
mainfrom
ci/pkg-pr-new

Conversation

@benjamincanac

Copy link
Copy Markdown
Member

Summary

  • Adds a pkg-pr-new publish step to CI after build and tests
  • Uses --compact --no-template --pnpm to match other Nuxt modules

Motivation

Enables continuous preview releases on PRs and pushes to main, so consumers can install @nuxt/icon from pkg.pr.new without waiting for an npm publish.

Setup

The pkg.pr.new GitHub App must be installed on this repository before the publish step succeeds.

Test plan

  • Merge after installing the pkg.pr.new app on the repo
  • Open or update a PR and confirm CI posts a preview install comment
  • Verify pnpm add https://pkg.pr.new/@nuxt/icon@<sha> installs the built module

Publish preview packages on each CI run so PRs get installable @nuxt/icon builds without an npm release.
@pkg-pr-new

pkg-pr-new Bot commented Jun 2, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/icon@495

commit: a8b084f

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates .github/workflows/ci.yml by adding a Publish step immediately after the Test step. The step runs: pnpx pkg-pr-new publish --compact --no-template --pnpm and the added snippet does not include an if condition.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description is well-related to the changeset, explaining the motivation, setup requirements, and test plan for the new pkg.pr.new preview publishing CI step.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title 'chore(github): add pkg.pr.new preview publishing' directly and clearly describes the main change: adding pkg.pr.new preview publishing to the GitHub CI workflow.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/pkg-pr-new

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

52-53: ⚡ Quick win

Consider adding graceful failure handling for missing app installation.

The PR description states "Merge after installing the pkg.pr.new app," but there's no safeguard if the app isn't installed. Currently, the publish step will fail and block the entire CI pipeline. Consider adding continue-on-error: true so CI can complete even if publishing fails, or add a conditional check.

♻️ Option 1: Allow CI to pass if publish fails
       - name: Publish
+        continue-on-error: true
         run: pnpx pkg-pr-new publish --compact --no-template --pnpm

This ensures build/test failures are caught while allowing publish issues to not block CI.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 52 - 53, The Publish step currently
runs "pnpx pkg-pr-new publish --compact --no-template --pnpm" with no safeguard;
update the CI step labeled "Publish" to handle a missing pkg.pr.new app by
either adding continue-on-error: true to the step or wrapping the publish
invocation in a conditional that checks for the app/credentials before running
(e.g., detect an env var or output from a prior check) so the pipeline won’t
fail if the app isn’t installed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 52-53: The Publish step currently runs for all pull_request events
including forks; add an if-condition on the Publish step to only run on pushes
to main or pull requests from the same repository. Modify the step with name
"Publish" to include an if expression such as: if: (github.event_name == 'push'
&& startsWith(github.ref, 'refs/heads/main')) || (github.event_name ==
'pull_request' && github.event.pull_request.head.repo.full_name ==
github.repository') so the pnpx pkg-pr-new publish command only executes in
those trusted contexts.
- Around line 52-53: Add explicit GitHub Actions permissions required by
pkg.pr.new to avoid OIDC/auth failures: at the workflow or the job that contains
the "Publish" step (the step running "pnpx pkg-pr-new publish --compact
--no-template --pnpm"), add permissions including id-token: write,
pull-requests: write, and contents: read so pkg.pr.new can perform OIDC auth,
post installation comments, and read repo contents.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 52-53: The Publish step currently runs "pnpx pkg-pr-new publish
--compact --no-template --pnpm" with no safeguard; update the CI step labeled
"Publish" to handle a missing pkg.pr.new app by either adding continue-on-error:
true to the step or wrapping the publish invocation in a conditional that checks
for the app/credentials before running (e.g., detect an env var or output from a
prior check) so the pipeline won’t fail if the app isn’t installed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5ec6331b-555d-41fe-b061-ba2cf9c0e3aa

📥 Commits

Reviewing files that changed from the base of the PR and between 7cafddc and 079adf6.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml
Skip publish on fork PRs and declare OIDC/PR permissions for pkg-pr-new.

ci: drop unneeded permissions block for pkg.pr.new

pkg.pr.new works through its GitHub App, so the workflow token scopes weren't required. Keeps the fork guard.

ci: drop fork guard to match other nuxt modules

Keeps the pkg.pr.new step consistent with @nuxt/ui and @nuxt/content.

ci: guard pkg.pr.new to the nuxt org

Matches nuxt/nuxt: skip preview publish on fork PRs.
@benjamincanac benjamincanac changed the title ci: add pkg.pr.new preview publishing chore(github): add pkg.pr.new preview publishing Jun 2, 2026
@benjamincanac
benjamincanac merged commit b13f778 into main Jun 2, 2026
5 checks passed
@benjamincanac
benjamincanac deleted the ci/pkg-pr-new branch June 2, 2026 09:07
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.

1 participant