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.
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
|
|
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
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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 ||
|
|
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>"\``);
|
package/bin/github/http.mjs
CHANGED
|
@@ -30,7 +30,12 @@ async function resolveToken() {
|
|
|
30
30
|
catch {
|
|
31
31
|
// fall through to error
|
|
32
32
|
}
|
|
33
|
-
|
|
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 {
|