pr-shepherd 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
3
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
4
- "version": "0.12.0",
4
+ "version": "0.12.1",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
7
7
  "email": "jonathanrichardong@gmail.com"
package/README.md CHANGED
@@ -276,14 +276,14 @@ actions:
276
276
  autoMarkReady: false # disable to stay draft until you manually promote
277
277
  ```
278
278
 
279
- Environment variables: `GH_TOKEN` / `GITHUB_TOKEN` (auth; falls back to `gh auth token`), `PR_SHEPHERD_STATE_DIR` (override loop-state and log base dir), `PR_SHEPHERD_LOG_DISABLED=1` (disable the per-worktree debug log), `AGENT=codex` or `CODEX_CI=1` (emit Codex-compatible monitor instructions).
279
+ Environment variables: `GH_TOKEN` / `GITHUB_TOKEN` (auth; falls back to `gh auth token`, then `GITHUB_PERSONAL_ACCESS_TOKEN`), `PR_SHEPHERD_STATE_DIR` (override loop-state and log base dir), `PR_SHEPHERD_LOG_DISABLED=1` (disable the per-worktree debug log), `AGENT=codex` or `CODEX_CI=1` (emit Codex-compatible monitor instructions).
280
280
 
281
281
  See [docs/configuration.md](docs/configuration.md) for full semantics and deprecated-key migration.
282
282
 
283
283
  ## Requirements
284
284
 
285
285
  - Node.js ≥ 22.0.0
286
- - A GitHub token: set `GH_TOKEN` or `GITHUB_TOKEN`, **or** install and authenticate the `gh` CLI (`gh auth login`) — pr-shepherd uses `gh auth token` as a fallback. The `repo` scope is required for private repositories.
286
+ - A GitHub token: set `GH_TOKEN` or `GITHUB_TOKEN`, **or** install and authenticate the `gh` CLI (`gh auth login`) — pr-shepherd uses `gh auth token` as a fallback before trying `GITHUB_PERSONAL_ACCESS_TOKEN`. The `repo` scope is required for private repositories.
287
287
  - `git`
288
288
 
289
289
  ## Docs
@@ -52,12 +52,10 @@ export async function handleFixCode(ctx) {
52
52
  const checks = toAgentChecks(failingChecks);
53
53
  const { changesRequestedReviews } = report;
54
54
  const hasConflicts = report.mergeStatus.status === "CONFLICTS";
55
- const needsPush = threads.length > 0 ||
56
- actionableComments.length > 0 ||
57
- checks.length > 0 ||
58
- changesRequestedReviews.length > 0 ||
59
- hasConflicts;
60
- const inProgressRunIds = needsPush ? buildInProgressRunIds(report, cancelledSet) : [];
55
+ const hasGuaranteedSupersedingPush = threads.length > 0 || checks.length > 0 || changesRequestedReviews.length > 0 || hasConflicts;
56
+ const inProgressRunIds = hasGuaranteedSupersedingPush
57
+ ? buildInProgressRunIds(report, cancelledSet)
58
+ : [];
61
59
  const allCommentIds = [...actionableComments.map((c) => c.id), ...reviewSummaryIds];
62
60
  const resolveCommand = buildResolveCommand(threads, resolutionOnlyThreads, allCommentIds, changesRequestedReviews, checks, prNumber);
63
61
  if (baseLookup.isFallback && (resolveCommand.requiresHeadSha || hasConflicts)) {
@@ -60,7 +60,7 @@ export function buildFixInstructions(threads, actionableComments, checks, review
60
60
  if (reviews.length > 0) {
61
61
  instructions.push(`For each bullet under \`## Changes-requested reviews\` above: read the review body and apply the requested changes.`);
62
62
  }
63
- const hasCodeChanges = threads.length > 0 || actionableComments.length > 0 || checks.length > 0 || reviews.length > 0;
63
+ const hasCodeChanges = threads.length > 0 || checks.length > 0 || reviews.length > 0;
64
64
  const needsPush = hasCodeChanges || hasConflicts;
65
65
  if (hasCodeChanges) {
66
66
  instructions.push(`Commit changed files: \`git add <files> && git commit -m "<descriptive message>"\``);
@@ -30,7 +30,12 @@ async function resolveToken() {
30
30
  catch {
31
31
  // fall through to error
32
32
  }
33
- throw new Error("No GitHub token found. Set GH_TOKEN or GITHUB_TOKEN, or run `gh auth login`.");
33
+ const codexToken = process.env["GITHUB_PERSONAL_ACCESS_TOKEN"];
34
+ if (codexToken) {
35
+ _token = codexToken;
36
+ return _token;
37
+ }
38
+ throw new Error("No GitHub token found. Set GH_TOKEN, GITHUB_TOKEN, or GITHUB_PERSONAL_ACCESS_TOKEN, or run `gh auth login`.");
34
39
  }
35
40
  async function makeHeaders() {
36
41
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Ong",