@botbuddy/cli 1.45.0 → 1.45.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/package.json +1 -1
- package/src/wait-core.mjs +6 -3
- package/src/wait.mjs +3 -3
package/package.json
CHANGED
package/src/wait-core.mjs
CHANGED
|
@@ -436,10 +436,13 @@ function prSubjectMatches(subjectKey, params) {
|
|
|
436
436
|
return subjectKey.startsWith(`${params.repo}#`);
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
// Does a commit field on a signal payload
|
|
440
|
-
//
|
|
439
|
+
// Does a commit field on a signal payload identify the same commit as the
|
|
440
|
+
// condition's SHA? GitHub may send either side as a 7–40-character prefix, so
|
|
441
|
+
// accept either prefix direction while refusing malformed payload values.
|
|
441
442
|
function shaPrefixMatches(value, sha) {
|
|
442
|
-
|
|
443
|
+
if (typeof value !== "string") return false;
|
|
444
|
+
const candidate = value.trim().toLowerCase();
|
|
445
|
+
return /^[0-9a-f]{7,40}$/.test(candidate) && (candidate.startsWith(sha) || sha.startsWith(candidate));
|
|
443
446
|
}
|
|
444
447
|
|
|
445
448
|
// BOT-1975: optional head scoping for pr-state. pr_state signals carry the PR
|
package/src/wait.mjs
CHANGED
|
@@ -78,8 +78,8 @@ CONDITIONS (TYPE:key=val,key=val — repeat for several; --any wakes on the fir
|
|
|
78
78
|
by the PR read model. Omit pr= to wake on ANY of your PRs
|
|
79
79
|
in the repo; or pass pr=<owner/repo#n> in one value. A
|
|
80
80
|
conflict/clean flip sets payload.mergeable_changed. The
|
|
81
|
-
payload carries head_ref_oid; sha=<head> (7-40 hex
|
|
82
|
-
|
|
81
|
+
payload carries head_ref_oid; sha=<head> (7-40 hex; either
|
|
82
|
+
side may be an abbreviated prefix) wakes only on signals for that head, so a
|
|
83
83
|
previous head's check result can't wake you. A push alone
|
|
84
84
|
emits nothing — the head rides on the next transition.
|
|
85
85
|
pr-review:repo=<owner/repo>[,pr=<n>][,reviewer=<login>][,sha=<commit>]
|
|
@@ -96,7 +96,7 @@ CONDITIONS (TYPE:key=val,key=val — repeat for several; --any wakes on the fir
|
|
|
96
96
|
existing review will not re-wake it.
|
|
97
97
|
reviewer=<login> wakes only on that reviewer (case-
|
|
98
98
|
insensitive; a trailing [bot] is ignored). sha=<commit>
|
|
99
|
-
wakes only on verdicts for that commit (submitted reviews
|
|
99
|
+
wakes only on verdicts for that commit (either side may be an abbreviated prefix; submitted reviews
|
|
100
100
|
and clean passes carry commit_sha; thread comments do not,
|
|
101
101
|
so they never match sha=); the usage-limit decline always
|
|
102
102
|
passes sha=. Any other key is refused (exit 4).
|