Skip to content

ci: use npm stage publish for 2FA - #6

Merged
riderx merged 4 commits into
mainfrom
ci/npm-stage-publish
Aug 20, 2026
Merged

riderx merged 4 commits into
mainfrom
ci/npm-stage-publish

Conversation

@riderx

@riderx riderx commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

What

  • Switch production and PR beta publishes from npm publish to npm stage publish.

Why

  • npm no longer allows long-lived unattended publish tokens.

How

  • Plugin CI stages the package with the org NPM_TOKEN.

Testing

  • Same change already shipped on @capgo/capacitor-wifi.

Not Tested

  • This repo's next GitHub release / /publish-beta on a live PR.

npm no longer allows long-lived bypass_2fa tokens. Stage the package in plugin CI, then let Cap-go/automations approve it.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your current included review allowance is based on your included PR review attempts over the past 7 days.

Next review available in: 41 minutes

Limit details: You’ve used the included review currently available. Your 60 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

You’re in a promotional period — use the checkbox below to run this review for free:

  • Run review for free

On-demand reviews are free for the next 31 days. After that, they cost $0.25 per reviewed file.

How can I continue?

Run this review now using the option above, or comment @coderabbitai review --use-credits.

You can also wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 649506aa-a25f-4b50-9960-c2e59de56df0

📥 Commits

Reviewing files that changed from the base of the PR and between dee5211 and 334cbdd.

📒 Files selected for processing (3)
  • .github/workflows/build.yml
  • .github/workflows/pr_beta_publish.yml
  • AGENTS.md

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

@github-actions

Copy link
Copy Markdown
Contributor

Beta npm build

Maintainers can publish this PR to npm for fast testing.

Comment /publish-beta after the PR checks are green.

The workflow will:

  • publish a prerelease package on the beta tag
  • add a pinned pr-6 dist-tag for this exact PR build
  • update this comment with the install command

Security note: beta publish is only enabled for branches inside this repository.

@riderx
riderx marked this pull request as ready for review August 20, 2026 00:50

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/build.yml">

<violation number="1" location=".github/workflows/build.yml:57">
P1: When this workflow stages the package with npm 11.15.0, npm removes its `bin` mapping, so installed releases no longer expose `capgo-capacitor-patch`. Fix the package’s bin metadata and verify the staged tarball retains the executable mapping before publishing.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

- name: Publish to npm with next tag
run: |
npm --version
npm stage publish --provenance --access public --ignore-scripts

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: When this workflow stages the package with npm 11.15.0, npm removes its bin mapping, so installed releases no longer expose capgo-capacitor-patch. Fix the package’s bin metadata and verify the staged tarball retains the executable mapping before publishing.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/build.yml, line 57:

<comment>When this workflow stages the package with npm 11.15.0, npm removes its `bin` mapping, so installed releases no longer expose `capgo-capacitor-patch`. Fix the package’s bin metadata and verify the staged tarball retains the executable mapping before publishing.</comment>

<file context>
@@ -46,16 +46,32 @@ jobs:
-      - name: Publish to npm with next tag
+        run: |
+          npm --version
+          npm stage publish --provenance --access public --ignore-scripts
+      - name: Stage publish to npm with next tag
         if: ${{ contains(github.ref, '-alpha.') }}
</file context>

Comment thread .github/workflows/pr_beta_publish.yml Resolved
Comment thread .github/workflows/pr_beta_publish.yml Resolved
Comment thread .github/workflows/pr_beta_publish.yml Resolved
riderx added 2 commits August 20, 2026 04:03
Stage publish cannot set pr-N tags without 2FA. Point testers at @beta/@Version after automations approves.
Stage publish cannot refresh dist-tags without 2FA. The in-progress comment must match that.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 1 file (changes from recent commits).

Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread .github/workflows/pr_beta_publish.yml Resolved
Plugin repos should not describe the internal approver.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/pr_beta_publish.yml">

<violation number="1" location=".github/workflows/pr_beta_publish.yml:247">
P3: The success comment now reads "Latest beta:" right after showing "Status: staged". The package is only staged at this point (the approval dispatch for the org's 2FA review runs with continue-on-error, and the beta becomes installable only after Cap-go/automations approves it). Removing the prior "(after Cap-go/automations approves the stage)" qualifier leaves the install commands (bun add package@beta) looking immediately available while the header still says staged, which can mislead a reader who tries them before approval. Keep the qualification or align the heading to the staged state.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@@ -236,11 +247,7 @@ jobs:
'Latest beta:',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The success comment now reads "Latest beta:" right after showing "Status: staged". The package is only staged at this point (the approval dispatch for the org's 2FA review runs with continue-on-error, and the beta becomes installable only after Cap-go/automations approves it). Removing the prior "(after Cap-go/automations approves the stage)" qualifier leaves the install commands (bun add package@beta) looking immediately available while the header still says staged, which can mislead a reader who tries them before approval. Keep the qualification or align the heading to the staged state.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/pr_beta_publish.yml, line 247:

<comment>The success comment now reads "Latest beta:" right after showing "Status: staged". The package is only staged at this point (the approval dispatch for the org's 2FA review runs with continue-on-error, and the beta becomes installable only after Cap-go/automations approves it). Removing the prior "(after Cap-go/automations approves the stage)" qualifier leaves the install commands (bun add package@beta) looking immediately available while the header still says staged, which can mislead a reader who tries them before approval. Keep the qualification or align the heading to the staged state.</comment>

<file context>
@@ -244,7 +244,7 @@ jobs:
               `Requested by @${actor}`,
               '',
-              'Latest beta (after Cap-go/automations approves the stage):',
+              'Latest beta:',
               '```sh',
               `bun add ${packageName}@beta`,
</file context>
Suggested change
'Latest beta:',
'Latest beta (after Cap-go/automations approves the stage):',

@riderx
riderx merged commit dc3abac into main Aug 20, 2026
7 checks passed
@riderx
riderx deleted the ci/npm-stage-publish branch August 20, 2026 09:27
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