-
-
Notifications
You must be signed in to change notification settings - Fork 9
docs(release): OIDC setup walkthrough + workflow diagnostics #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -288,9 +288,40 @@ jobs: | |
| fi | ||
|
|
||
| echo "Publishing to npm with tag: $NPM_TAG" | ||
| # Using OIDC trusted publisher - no token needed | ||
| # --provenance adds verified build attestation | ||
| npm publish --tag $NPM_TAG --provenance --access public | ||
| # Using OIDC trusted publisher — no NPM_TOKEN required. | ||
| # --provenance attaches a verified build attestation to the tarball. | ||
| # | ||
| # If this step 404s, npm has not registered this repo+workflow as a | ||
| # trusted publisher. Fix path (one-time): | ||
| # https://www.npmjs.com/package/glin-profanity/access | ||
| # → Publishing access → Add trusted publisher → GitHub Actions: | ||
| # Organization: glincker | ||
| # Repository: glin-profanity | ||
| # Workflow: auto-release.yml | ||
| # Environment: npm-publish | ||
| # See docs/RELEASING.md for the full walkthrough. | ||
| if ! npm publish --tag "$NPM_TAG" --provenance --access public; then | ||
| cat >&2 <<'EOF' | ||
|
|
||
| ============================================================= | ||
| npm publish failed. This is almost always because the npm | ||
| trusted-publisher registration on this package does not match | ||
| the workflow that just ran. | ||
|
|
||
| Fix: | ||
| 1. Visit https://www.npmjs.com/package/glin-profanity/access | ||
| 2. Add a GitHub Actions trusted publisher with exactly: | ||
| Organization: glincker | ||
| Repository: glin-profanity | ||
| Workflow: auto-release.yml | ||
| Environment: npm-publish | ||
| 3. Re-run this workflow (gh run rerun <id> --failed). | ||
|
|
||
| See docs/RELEASING.md for the full one-time setup. | ||
| ============================================================= | ||
| EOF | ||
| exit 1 | ||
| fi | ||
|
Comment on lines
+303
to
+324
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Banner fires for every publish failure, not just 404. The fix instructions in the emitted banner assume a trusted-publisher mismatch (404), but this branch runs on any non-zero exit — including 403 (2FA/ownership), network errors, registry outages, or the "version already exists" race (if the pre-check at Line 275 missed it). Operators hitting a 403 will be pointed at the wrong remediation. The "almost always" hedge helps but the explicit 4-step fix is still misleading. Consider either (a) scoping the banner to 404 by capturing npm's exit or stderr, or (b) restructuring the banner so the 404 fix is clearly one branch alongside the 403/other guidance already documented in ♻️ Sketch of a more discriminating variant- if ! npm publish --tag "$NPM_TAG" --provenance --access public; then
- cat >&2 <<'EOF'
-
-=============================================================
-npm publish failed. This is almost always because the npm
-trusted-publisher registration on this package does not match
-the workflow that just ran.
-
-Fix:
- 1. Visit https://www.npmjs.com/package/glin-profanity/access
- 2. Add a GitHub Actions trusted publisher with exactly:
- Organization: glincker
- Repository: glin-profanity
- Workflow: auto-release.yml
- Environment: npm-publish
- 3. Re-run this workflow (gh run rerun <id> --failed).
-
-See docs/RELEASING.md for the full one-time setup.
-=============================================================
-EOF
- exit 1
- fi
+ PUBLISH_LOG=$(mktemp)
+ if ! npm publish --tag "$NPM_TAG" --provenance --access public 2> >(tee "$PUBLISH_LOG" >&2); then
+ cat >&2 <<'EOF'
+
+=============================================================
+npm publish failed. See docs/RELEASING.md#diagnosing-publish-failures.
+EOF
+ if grep -qE '404|Not Found' "$PUBLISH_LOG"; then
+ cat >&2 <<'EOF'
+
+Likely cause: trusted-publisher mismatch. Fix:
+ 1. https://www.npmjs.com/package/glin-profanity/access
+ 2. Add a GitHub Actions trusted publisher with exactly:
+ Organization: glincker
+ Repository: glin-profanity
+ Workflow: auto-release.yml
+ Environment: npm-publish
+ 3. gh run rerun <id> --failed
+EOF
+ elif grep -qE '403|Two-factor|OTP' "$PUBLISH_LOG"; then
+ echo "Likely cause: 2FA/ownership. See RELEASING.md §'403'." >&2
+ fi
+ echo "=============================================================" >&2
+ exit 1
+ fiNote: the 🧰 Tools🪛 actionlint (1.7.12)[error] 306-306: could not parse as YAML: could not find expected ':' (syntax-check) 🪛 YAMLlint (1.38.0)[error] 307-307: syntax error: could not find expected ':' (syntax) 🤖 Prompt for AI Agents |
||
|
|
||
| # Publish to PyPI | ||
| publish-pypi: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,144 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Releasing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| glin-profanity publishes to **npm** (JS/TS), **PyPI** (Python), and cuts a **GitHub Release** with a signed tag. All three fire automatically from a single merge to `release` via `.github/workflows/auto-release.yml`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+4
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This document covers the one-time setup needed for the automated pipeline to work end-to-end, plus fallback paths when something breaks. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## TL;DR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Merge a conventional-commit PR to `release`, or push a commit whose subject starts with `release: minor`, `release: patch`, etc. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - The workflow detects the bump, builds, publishes to npm + PyPI, and creates a GitHub Release. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **No tokens in GitHub Secrets.** Trust is established via OIDC. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **No tokens in GitHub Secrets.** Trust is established via OIDC. | |
| - **No `NPM_TOKEN` in GitHub Secrets.** npm publishing uses OIDC; PyPI may still use `PYPI_TOKEN` until trusted publishing is configured there. |
Copilot
AI
Apr 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trigger table lists patterns like release: patch / release: minor without the trailing space that the current detection code expects (it matches release: patch etc.). Consider updating the table entries to release: patch <...> / release: minor <...> (or loosen the detection regex) to avoid false expectations when someone copies these literals.
| | `release: patch` | patch bump | | |
| | `release: minor` | minor bump | | |
| | `release: major` | major bump | | |
| | `release: beta-minor` | minor bump on beta channel | | |
| | `release: alpha-patch` | patch bump on alpha channel | | |
| | `release: patch <...>` | patch bump | | |
| | `release: minor <...>` | minor bump | | |
| | `release: major <...>` | major bump | | |
| | `release: beta-minor <...>` | minor bump on beta channel | | |
| | `release: alpha-patch <...>` | patch bump on alpha channel | |
Copilot
AI
Apr 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc says commit subjects starting with release: patch, release: minor, etc. trigger bumps, but the current detection regex in scripts/sync-versions.js requires a trailing space after the type (e.g. ^release: patch ). A subject exactly release: patch would not match—update the doc examples to include an additional message after the type, or adjust the regex to accept end-of-line.
| The workflow triggers on every push to `release`. `scripts/sync-versions.js detect` parses the latest commit subject. Patterns that trigger a bump: | |
| | Commit subject starts with | Result | | |
| |---|---| | |
| | `release: patch` | patch bump | | |
| | `release: minor` | minor bump | | |
| | `release: major` | major bump | | |
| | `release: beta-minor` | minor bump on beta channel | | |
| | `release: alpha-patch` | patch bump on alpha channel | | |
| The workflow triggers on every push to `release`. `scripts/sync-versions.js detect` parses the latest commit subject. Example commit subjects that trigger a bump: | |
| | Commit subject | Result | | |
| |---|---| | |
| | `release: patch cut release` | patch bump | | |
| | `release: minor cut release` | minor bump | | |
| | `release: major cut release` | major bump | | |
| | `release: beta-minor cut release` | minor bump on beta channel | | |
| | `release: alpha-patch cut release` | patch bump on alpha channel | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trusted-publisher guidance banner is printed for any
npm publishfailure, but the surrounding comments/PR description frame it as 404-specific. Consider capturingnpm publishoutput and only printing this banner when the output indicates a 404/E404; otherwise, emit a generic failure message so 403/network/other errors don’t get misdiagnosed.