Skip to content

fix(ui): misc field updates #203

fix(ui): misc field updates

fix(ui): misc field updates #203

name: notify-next-canary
# Runs on `pull_request_target` so the sticky comment also works on PRs from
# forks (regular `pull_request` workflows have a read-only GITHUB_TOKEN on
# fork PRs and cannot post comments). This is safe because the probe only
# calls `npm view` and never checks out or executes PR code.
on:
pull_request_target:
types: [opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Detects upstream Next.js canary publishes that are missing `@next/env` or
# `@next/eslint-plugin-next` for the same version (would break
# `pnpm create next-app@canary` with `ERR_PNPM_NO_MATCHING_VERSION`).
probe:
runs-on: ubuntu-24.04
outputs:
healthy: ${{ steps.probe.outputs.healthy }}
next_version: ${{ steps.probe.outputs.next_version }}
steps:
- name: Probe registry for complete canary publish
id: probe
run: |
retry_npm_view() {
local spec="$1"
for attempt in 1 2 3; do
if npm view "$spec" version >/dev/null 2>&1; then
return 0
fi
sleep $((attempt * 2))
done
return 1
}
NEXT_VERSION=""
for attempt in 1 2 3; do
NEXT_VERSION="$(npm view next@canary version 2>/dev/null || true)"
if [ -n "$NEXT_VERSION" ]; then
break
fi
sleep $((attempt * 2))
done
echo "Resolved next@canary version: ${NEXT_VERSION:-<empty>}"
echo "next_version=${NEXT_VERSION}" >> "$GITHUB_OUTPUT"
if [ -z "$NEXT_VERSION" ]; then
echo "healthy=unknown" >> "$GITHUB_OUTPUT"
exit 0
fi
if retry_npm_view "@next/env@${NEXT_VERSION}" \
&& retry_npm_view "@next/eslint-plugin-next@${NEXT_VERSION}"; then
echo "healthy=true" >> "$GITHUB_OUTPUT"
else
echo "healthy=false" >> "$GITHUB_OUTPUT"
fi
notify:
runs-on: ubuntu-24.04
needs: probe
permissions:
pull-requests: write
steps:
- name: Post sticky PR comment about Next.js canary breakage
if: needs.probe.outputs.healthy == 'false'
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
with:
header: next-canary-broken
message: |
## Heads-up: Next.js canary publish is incomplete on npm
CI detected that the current `next@canary` (`${{ needs.probe.outputs.next_version }}`) is missing one of its peer packages (`@next/env` or `@next/eslint-plugin-next`) for the same version on the npm registry, so `pnpm create next-app@canary` would fail with `ERR_PNPM_NO_MATCHING_VERSION`. This is unrelated to this PR.
**This will not block your PR.** The `Canary` variants of `test/create-payload-app/int.spec.ts` are being skipped for this run via Vitest's `-t` filter; the rest of the suite still runs normally and this comment is purely informational.
Please open an issue in [vercel/next.js](https://github.com/vercel/next.js/issues/new/choose) as soon as possible so the upstream team can republish a complete canary, then re-run CI on this PR once a new canary is out to confirm the fix.
- name: Remove sticky PR comment when canary is healthy again
if: needs.probe.outputs.healthy == 'true'
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
with:
header: next-canary-broken
delete: true