Add label-triggered workflow to rebuild the action bundle#47
Merged
Conversation
When the needs-bundle-rebuild label lands on a PR (Renovate adds it for bumps to deps compiled into the publish-action bundle), rebuild the bundle and push the refreshed dist so the "Verify action bundle" check passes without a manual `pnpm build:action`. Prefers a BUNDLE_REBUILD_TOKEN secret so the push re-triggers required checks; falls back to GITHUB_TOKEN (which commits the fresh dist but can't re-run CI, per GitHub's loop-prevention). Same-repo PRs only.
Mint an App token (actions/create-github-app-token, client-id: APP_ID / private-key: APP_PRIVATE_KEY, matching the org convention in vite-plus) and checkout/push with it, so the push re-triggers the PR's required checks. Drops the GITHUB_TOKEN fallback.
fengmk2
added a commit
to voidzero-dev/setup-vp
that referenced
this pull request
Jul 1, 2026
Renovate bumps to bundled deps (\`@actions/*\`, \`yaml\`, \`zod\`) or to the \`vite-plus\` bundler change \`dist/index.mjs\`, which fails the "Verify dist is up to date" check until someone manually runs \`vp run build\` and commits. This adapts the label-triggered rebuild approach from voidzero-dev/pkg-pr-registry-bridge#47: - New \`.github/workflows/rebuild-bundle.yml\`: on the \`needs-bundle-rebuild\` label (same-repo PRs only), rebuild \`dist/\` and push it back to the PR branch. Uses a GitHub App token so the push re-triggers the PR's required checks. - \`.github/renovate.json\`: attach the \`needs-bundle-rebuild\` label to runtime \`dependencies\` and to \`vite-plus\`, the bumps that can change the bundle. Relies on the org secrets \`APP_ID\` / \`APP_PRIVATE_KEY\` (same App/secrets as the reference repo).
fengmk2
added a commit
that referenced
this pull request
Jul 1, 2026
The `needs-bundle-rebuild` label already triggers `rebuild-bundle.yml` (added in #47), which re-runs `pnpm build:action` and pushes the refreshed dist. The `prBodyNote` still instructed maintainers to do that by hand, so following it caused duplicate/racing pushes (non-fast-forward rejects) once the bot had already pushed. Rewrite the note and the rule's internal description to state the rebuild happens automatically via the label, with a fork-PR fallback (the bot can't push to fork branches). Config-only, no behavior change to the automation itself. Surfaced by a code review of the recent Renovate/bundle-rebuild changes.
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.
Completes the bundle-freshness automation. Pairs with the
needs-bundle-rebuildlabel (created) and the Renovate rule in #46.Flow
nanotar/esbuild) → adds theneeds-bundle-rebuildlabel (Renovate: honor pnpm's minimum-release-age and flag bundle-affecting deps #46's rule).pull_request: labeled, guarded to that label, rebuilds viapnpm build:action, and pushes the refreshed.github/actions/publish-preview/distif it changed.App token
A push made with the default
GITHUB_TOKENdoes not re-trigger a PR's required checks (GitHub loop prevention). So it mints a GitHub App token first and checks out / pushes with it, matching the org convention (actions/create-github-app-token,client-id: APP_ID/private-key: APP_PRIVATE_KEY, same as vite-plus'supdate-node-release-keys.yml).Needs the
APP_IDandAPP_PRIVATE_KEYsecrets available to this repo (org-level, or granted). The App needscontents: writeon the repo.Same-repo PRs only (fork branches can't be pushed to; Renovate is same-repo).