-
Notifications
You must be signed in to change notification settings - Fork 1
doctor + pulp pr: surface missing RELEASE_BOT_TOKEN secret #149
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
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 |
|---|---|---|
|
|
@@ -96,7 +96,10 @@ int run_passthrough(const std::string& cmd) { | |
|
|
||
| // ── Helpers ───────────────────────────────────────────────────────────── | ||
|
|
||
| std::string trim(const std::string& s) { | ||
| // Local trim — defined as static so it doesn't collide with the | ||
| // equivalent non-static definition in cli_common.cpp. Both have the same | ||
| // behavior; we keep the local one to avoid forcing a header rebuild. | ||
| static std::string trim(const std::string& s) { | ||
| size_t a = s.find_first_not_of(" \t\r\n"); | ||
| if (a == std::string::npos) return {}; | ||
| size_t b = s.find_last_not_of(" \t\r\n"); | ||
|
|
@@ -274,6 +277,29 @@ int cmd_pr(const std::vector<std::string>& args) { | |
| return 0; | ||
| } | ||
|
|
||
| // Best-effort heads-up: warn if RELEASE_BOT_TOKEN is missing on the | ||
| // active GitHub repo. Doesn't block — gates and merge are unaffected | ||
| // — but surfacing the trap here means the user finds out before they | ||
| // wonder why the post-merge GitHub Release never appeared. | ||
| { | ||
| auto repo = ::trim(run_capture("gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null").stdout_text); | ||
| if (!repo.empty() && repo.find('/') != std::string::npos) { | ||
| auto secrets = run_capture( | ||
| "gh api 'repos/" + repo + "/actions/secrets' " | ||
| "--jq '.secrets[].name' 2>/dev/null").stdout_text; | ||
| if (!secrets.empty() && secrets.find("RELEASE_BOT_TOKEN") == std::string::npos) { | ||
|
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.
The warning path requires Useful? React with 👍 / 👎. |
||
| std::cerr << color::yellow() | ||
| << "\n▸ Heads-up: RELEASE_BOT_TOKEN secret is missing on " | ||
| << repo << ".\n" | ||
| << " Auto-release will tag the version bump but " | ||
| "the binary release workflows won't fire.\n" | ||
| << " Run `pulp doctor` for the one-time setup steps " | ||
| "(or see docs/guides/versioning.md).\n" | ||
| << color::reset(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Step 1: skill-sync — must pass before any file is rewritten. | ||
| if (int rc = step_skill_sync(root, opt.base); rc != 0) { | ||
| std::cerr << "\npulp pr: skill-sync gate failed. Update the listed SKILL.md(s)\n" | ||
|
|
||
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.
This check only emits a
DoctorCheckwhensecrets_listis non-empty, but--jq '.secrets[].name'returns an empty string when a repository has zero Actions secrets. In that common bootstrap case,pulp doctorwill skip theRELEASE_BOT_TOKENrow entirely instead of reporting it as missing, so contributors still hit the silent post-merge release failure this change is meant to prevent.Useful? React with 👍 / 👎.