Every publish run on main since 13:27 UTC 10-14 is red: opencode-zed-auth 0.1.7 and opencode-zen-free-auth 0.1.6 answer 404 because their Trusted Publisher isn't set, and a new package (opendesign-auth, AstraFlow) can't be created by OIDC at all. Each of those needed an org owner's OTP by hand. npm tries OIDC first and falls back to the token in .npmrc, so publish.yml now hands setup-node's NODE_AUTH_TOKEN the repository's NPM_TOKEN secret. publish.sh publishes a new package when the token is there instead of passing it by, and its errors say which of the two is missing or that the token expired. The PR check now notes a new package instead of failing, since the merge publishes it. README gains a Publishing section with the one-time token setup. Run: sh -n on both scripts; scripts/new-to-npm.sh against npm (every package is on npm); scripts/publish.sh with GITHUB_ACTIONS=true and a fake npm on PATH (zed-auth "new"): token -> published with the token, exit 0; no token -> ::error naming it, exit 1; token refused -> ::error saying replace the token, exit 1. Not tried: a real publish with a token, since the secret doesn't exist yet.
36 lines
860 B
YAML
36 lines
860 B
YAML
# Checks a pull request before it is merged: the tests publish.yml runs, and
|
|
# names any package new to npm (scripts/new-to-npm.sh), which the merge
|
|
# publishes with the NPM_TOKEN secret.
|
|
name: pr
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: oven-sh/setup-bun@v2
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
- name: test
|
|
# the tests refuse a real home: no real sign-in is ever read
|
|
run: HOME=$(mktemp -d) bun test
|
|
- name: check
|
|
run: bun scripts/check.mjs
|
|
|
|
on-npm:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
- name: packages new to npm
|
|
run: scripts/new-to-npm.sh
|