@decohere/ci-tools 0.0.1-dev.113 → 0.0.1-dev.114
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
CHANGED
package/src/lib/github-issue.mjs
CHANGED
|
@@ -47,7 +47,9 @@ export function upsertIssue(options, run = gh) {
|
|
|
47
47
|
"--limit",
|
|
48
48
|
"200",
|
|
49
49
|
"--search",
|
|
50
|
-
|
|
50
|
+
// Quoted: GitHub's search can't match a title like `security(ci): …` unquoted (#681).
|
|
51
|
+
// The exact-title match in pickIssue still decides.
|
|
52
|
+
`"${title.replaceAll('"', "")}" in:title`,
|
|
51
53
|
"--json",
|
|
52
54
|
"number,title,state,url",
|
|
53
55
|
]),
|
|
@@ -28,6 +28,17 @@ describe("github-issue", () => {
|
|
|
28
28
|
expect(pickIssue([], TITLE)).toBeNull();
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
+
// #681: GitHub's search can't match `security(ci): …` unquoted, so the lookup found nothing
|
|
32
|
+
// and a new issue was opened on every run.
|
|
33
|
+
it("searches for the title as a quoted phrase", () => {
|
|
34
|
+
const { run, calls } = fakeGh([]);
|
|
35
|
+
upsertIssue({ title: "security(ci): npm audit vulnerabilities detected", body: "b" }, run);
|
|
36
|
+
const args = calls[0].args;
|
|
37
|
+
expect(args[args.indexOf("--search") + 1]).toBe(
|
|
38
|
+
'"security(ci): npm audit vulnerabilities detected" in:title',
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
|
|
31
42
|
it("opens an issue with assignees when none has the title", () => {
|
|
32
43
|
const { run, calls } = fakeGh([]);
|
|
33
44
|
const result = upsertIssue({ title: TITLE, body: "body", assignees: ["das974"] }, run);
|