From d8118eae98a2cec95db0bb92e2937102653fb647 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 6 Jul 2024 23:55:28 +0200 Subject: [PATCH 01/25] try querying the title --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 8dc8435..c6deffd 100644 --- a/action.yaml +++ b/action.yaml @@ -59,7 +59,7 @@ runs: // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query($owner:String!, $name:String!, $creator:String!, $label:String!){ repository(owner: $owner, name: $name) { - issues(first: 1, states: OPEN, filterBy: {createdBy: $creator, labels: [$label]}, orderBy: {field: CREATED_AT, direction: DESC}) { + issues(first: 1, states: OPEN, filterBy: {createdBy: $creator, labels: [$label], title: $title}, orderBy: {field: CREATED_AT, direction: DESC}) { edges { node { body From 58bf3852a79fbbe6480e760ed806bc8e75ff6a8b Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 00:03:03 +0200 Subject: [PATCH 02/25] declare the title as a parameter --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index c6deffd..8da39da 100644 --- a/action.yaml +++ b/action.yaml @@ -57,7 +57,7 @@ runs: const issue_body = `[Workflow Run URL](${workflow_url})\n${pytest_logs}` // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures - const query = `query($owner:String!, $name:String!, $creator:String!, $label:String!){ + const query = `query($owner:String!, $name:String!, $creator:String!, $title:String!, $label:String!){ repository(owner: $owner, name: $name) { issues(first: 1, states: OPEN, filterBy: {createdBy: $creator, labels: [$label], title: $title}, orderBy: {field: CREATED_AT, direction: DESC}) { edges { From 43918266e717b5caa48266875c607222f8c75de2 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 00:03:31 +0200 Subject: [PATCH 03/25] trigger CI From 911e6eedadc03a2349c2ede958563d8f0c188d40 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 00:05:27 +0200 Subject: [PATCH 04/25] pass the title --- action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yaml b/action.yaml index 8da39da..8c4dc30 100644 --- a/action.yaml +++ b/action.yaml @@ -75,6 +75,7 @@ runs: owner: context.repo.owner, name: context.repo.repo, label: "${{ inputs.issue-label }}", + title: "${{ inputs.issue-title }}", creator: "github-actions[bot]" } const result = await github.graphql(query, variables) From 6d89cf56ff385be33c67889c8727d1a59a701096 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 00:55:46 +0200 Subject: [PATCH 05/25] try using the search connection --- action.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/action.yaml b/action.yaml index 8c4dc30..5df57de 100644 --- a/action.yaml +++ b/action.yaml @@ -58,14 +58,12 @@ runs: // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query($owner:String!, $name:String!, $creator:String!, $title:String!, $label:String!){ - repository(owner: $owner, name: $name) { - issues(first: 1, states: OPEN, filterBy: {createdBy: $creator, labels: [$label], title: $title}, orderBy: {field: CREATED_AT, direction: DESC}) { - edges { - node { - body - id - number - } + search(query: "repo:$owner/$name author:$creator label:$label in:title $title", type:ISSUE, first: 1) { + edges { + node { + body + id + number } } } @@ -76,7 +74,7 @@ runs: name: context.repo.repo, label: "${{ inputs.issue-label }}", title: "${{ inputs.issue-title }}", - creator: "github-actions[bot]" + creator: "app/github-actions" } const result = await github.graphql(query, variables) From 1f9e05a74592b6d936b075d37da22f500501ff30 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 01:22:00 +0200 Subject: [PATCH 06/25] try combining before passing to the query --- action.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/action.yaml b/action.yaml index 5df57de..0d544ee 100644 --- a/action.yaml +++ b/action.yaml @@ -58,12 +58,18 @@ runs: // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query($owner:String!, $name:String!, $creator:String!, $title:String!, $label:String!){ - search(query: "repo:$owner/$name author:$creator label:$label in:title $title", type:ISSUE, first: 1) { - edges { - node { - body - id - number + const query = `repo:$owner/$name author:$creator label:$label is:open in:title $title`; + + { + search(query: "repo:$owner/$name author:$creator label:$label in:title is:open $title", type:ISSUE, first: 1) { + edges { + node { + ... on Issue { + body + id + number + } + } } } } From f5b6592d20c8c4a2322789dbb66b0b15907a2c04 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 01:23:57 +0200 Subject: [PATCH 07/25] use braces --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 0d544ee..6a44740 100644 --- a/action.yaml +++ b/action.yaml @@ -58,7 +58,7 @@ runs: // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query($owner:String!, $name:String!, $creator:String!, $title:String!, $label:String!){ - const query = `repo:$owner/$name author:$creator label:$label is:open in:title $title`; + const query = `repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}`; { search(query: "repo:$owner/$name author:$creator label:$label in:title is:open $title", type:ISSUE, first: 1) { From b3a602575a8f49aacd908a0a0534da21709a10cb Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 01:24:05 +0200 Subject: [PATCH 08/25] pass as a query object --- action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 6a44740..8673570 100644 --- a/action.yaml +++ b/action.yaml @@ -60,8 +60,8 @@ runs: const query = `query($owner:String!, $name:String!, $creator:String!, $title:String!, $label:String!){ const query = `repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}`; - { - search(query: "repo:$owner/$name author:$creator label:$label in:title is:open $title", type:ISSUE, first: 1) { + query { + search(query: $query, type:ISSUE, first: 1) { edges { node { ... on Issue { From 74f1a6868d63794a354e3fdc1be5fc099e87de62 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 01:27:50 +0200 Subject: [PATCH 09/25] move the entire query construction to a separate variable --- action.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/action.yaml b/action.yaml index 8673570..cbb1d8d 100644 --- a/action.yaml +++ b/action.yaml @@ -58,8 +58,6 @@ runs: // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query($owner:String!, $name:String!, $creator:String!, $title:String!, $label:String!){ - const query = `repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}`; - query { search(query: $query, type:ISSUE, first: 1) { edges { @@ -74,13 +72,14 @@ runs: } } }`; + const owner = context.repo.owner; + const name = context.repo.repo; + const label = "${{ input.issue-label }}"; + const title = "${{ input.issue-title }}"; + const creator = "app/github-actions"; const variables = { - owner: context.repo.owner, - name: context.repo.repo, - label: "${{ inputs.issue-label }}", - title: "${{ inputs.issue-title }}", - creator: "app/github-actions" + query: `repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}`; } const result = await github.graphql(query, variables) From 5b15f0350c1a2adddd65d483d3d6ec08429bf372 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 01:29:54 +0200 Subject: [PATCH 10/25] fix the label --- action.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index cbb1d8d..ef2f7be 100644 --- a/action.yaml +++ b/action.yaml @@ -74,8 +74,7 @@ runs: }`; const owner = context.repo.owner; const name = context.repo.repo; - const label = "${{ input.issue-label }}"; - const title = "${{ input.issue-title }}"; + const label = "${{ inputs.issue-label }}"; const creator = "app/github-actions"; const variables = { From 59bee6aad6530207d8d5f322635731cb081e106f Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 01:31:04 +0200 Subject: [PATCH 11/25] remove a wrong semicolon --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index ef2f7be..e4c80f7 100644 --- a/action.yaml +++ b/action.yaml @@ -78,7 +78,7 @@ runs: const creator = "app/github-actions"; const variables = { - query: `repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}`; + query: `repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}` } const result = await github.graphql(query, variables) From 4d5b3432084f8e77b5e6c349c8cf11f376a5d179 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 01:32:54 +0200 Subject: [PATCH 12/25] use a different parameter name --- action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yaml b/action.yaml index e4c80f7..43eb169 100644 --- a/action.yaml +++ b/action.yaml @@ -57,9 +57,9 @@ runs: const issue_body = `[Workflow Run URL](${workflow_url})\n${pytest_logs}` // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures - const query = `query($owner:String!, $name:String!, $creator:String!, $title:String!, $label:String!){ + const query = `query($value:String!) { query { - search(query: $query, type:ISSUE, first: 1) { + search(query: $value, type:ISSUE, first: 1) { edges { node { ... on Issue { @@ -78,7 +78,7 @@ runs: const creator = "app/github-actions"; const variables = { - query: `repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}` + value: `repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}` } const result = await github.graphql(query, variables) From e7cac202e08d0810b9b80af2e2051f77f1b4b023 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 01:34:07 +0200 Subject: [PATCH 13/25] remove the extra query level --- action.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/action.yaml b/action.yaml index 43eb169..022dcd1 100644 --- a/action.yaml +++ b/action.yaml @@ -58,15 +58,13 @@ runs: // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query($value:String!) { - query { - search(query: $value, type:ISSUE, first: 1) { - edges { - node { - ... on Issue { - body - id - number - } + search(query: $value, type:ISSUE, first: 1) { + edges { + node { + ... on Issue { + body + id + number } } } From 9816159ffb3615121caaa95a2e3942d0550b497e Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 01:38:53 +0200 Subject: [PATCH 14/25] adapt to the changed variables and result structure --- action.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/action.yaml b/action.yaml index 022dcd1..a215c82 100644 --- a/action.yaml +++ b/action.yaml @@ -82,20 +82,20 @@ runs: // If no issue is open, create a new issue, // else update the body of the existing issue. - if (result.repository.issues.edges.length === 0) { + if (result.search.edges.length === 0) { github.rest.issues.create({ - owner: variables.owner, - repo: variables.name, + owner: owner, + repo: name, body: issue_body, title: title, - labels: [variables.label], + labels: [label], assignees: assignees }) } else { github.rest.issues.update({ - owner: variables.owner, - repo: variables.name, - issue_number: result.repository.issues.edges[0].node.number, + owner: owner, + repo: name, + issue_number: result.search.edges[0].node.number, body: issue_body }) } From 4609cbed749de6a347477768b6c35198d5427cd7 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 02:02:11 +0200 Subject: [PATCH 15/25] document the change --- README.md | 2 ++ action.yaml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a294f0..96f4f4c 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,8 @@ In case you don't like the default title for new issues, this setting can be use issue-title: "Nightly CI failed" ``` +The title can also be parametrized, in which case a separate issue will be opened for each variation of the title. + ### issue label optional. Default: `CI` diff --git a/action.yaml b/action.yaml index a215c82..9156d2e 100644 --- a/action.yaml +++ b/action.yaml @@ -8,7 +8,8 @@ inputs: required: true issue-title: description: >- - Title of issue being created or updated + Title of issue being created or updated. Can be a parametrized string, in which case + a new issue will be opened for all variations. required: false default: "⚠️ Nightly upstream-dev CI failed ⚠️" issue-label: From fddfe8c730f0ed1276b6706380684ce4088d99e4 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:22:41 +0200 Subject: [PATCH 16/25] add semicolons at the end of each line Co-authored-by: Agriya Khetarpal --- action.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yaml b/action.yaml index 9156d2e..085cce8 100644 --- a/action.yaml +++ b/action.yaml @@ -52,10 +52,10 @@ runs: script: | const fs = require('fs'); const pytest_logs = fs.readFileSync('pytest-logs.txt', 'utf8'); - const title = "${{ inputs.issue-title }}" - const assignees = "${{inputs.assignees}}".split(",") - const workflow_url = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}` - const issue_body = `[Workflow Run URL](${workflow_url})\n${pytest_logs}` + const title = "${{ inputs.issue-title }}"; + const assignees = "${{inputs.assignees}}".split(","); + const workflow_url = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; + const issue_body = `[Workflow Run URL](${workflow_url})\n${pytest_logs}`; // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query($value:String!) { From 74c02db9485d58b9995856d19003eb81da9b55da Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:26:13 +0200 Subject: [PATCH 17/25] try going back to assembling the string within the query construction --- action.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/action.yaml b/action.yaml index 085cce8..fc5d874 100644 --- a/action.yaml +++ b/action.yaml @@ -58,8 +58,8 @@ runs: const issue_body = `[Workflow Run URL](${workflow_url})\n${pytest_logs}`; // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures - const query = `query($value:String!) { - search(query: $value, type:ISSUE, first: 1) { + const query = `query($owner:String!, $name:String!, $creator:String!, $label:String!, $title:String!) { + search(query: "repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}", type:ISSUE, first: 1) { edges { node { ... on Issue { @@ -71,13 +71,13 @@ runs: } } }`; - const owner = context.repo.owner; - const name = context.repo.repo; - const label = "${{ inputs.issue-label }}"; - const creator = "app/github-actions"; const variables = { - value: `repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}` + owner: context.repo.owner, + name: context.repo.repo, + label: "${{ inputs.issue-label }}"; + creator: "app/github-actions", + title: "${{ inputs.issue-title }}" } const result = await github.graphql(query, variables) From ba8289f95750ad111422540172f4b3562d95ac40 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:30:10 +0200 Subject: [PATCH 18/25] typo --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index fc5d874..23d836b 100644 --- a/action.yaml +++ b/action.yaml @@ -75,7 +75,7 @@ runs: const variables = { owner: context.repo.owner, name: context.repo.repo, - label: "${{ inputs.issue-label }}"; + label: "${{ inputs.issue-label }}", creator: "app/github-actions", title: "${{ inputs.issue-title }}" } From 793b8b8a537a0c8bd806e44b7ba7d077d13e38f9 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:30:16 +0200 Subject: [PATCH 19/25] more semicolons --- action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yaml b/action.yaml index 23d836b..10cef52 100644 --- a/action.yaml +++ b/action.yaml @@ -79,7 +79,7 @@ runs: creator: "app/github-actions", title: "${{ inputs.issue-title }}" } - const result = await github.graphql(query, variables) + const result = await github.graphql(query, variables); // If no issue is open, create a new issue, // else update the body of the existing issue. @@ -91,12 +91,12 @@ runs: title: title, labels: [label], assignees: assignees - }) + }); } else { github.rest.issues.update({ owner: owner, repo: name, issue_number: result.search.edges[0].node.number, body: issue_body - }) + }); } From 241e36d955cd423db53bfdd43e629bde6517d83a Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:32:12 +0200 Subject: [PATCH 20/25] refer to the variables object whenever necessary --- action.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/action.yaml b/action.yaml index 10cef52..f2cec39 100644 --- a/action.yaml +++ b/action.yaml @@ -52,7 +52,6 @@ runs: script: | const fs = require('fs'); const pytest_logs = fs.readFileSync('pytest-logs.txt', 'utf8'); - const title = "${{ inputs.issue-title }}"; const assignees = "${{inputs.assignees}}".split(","); const workflow_url = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; const issue_body = `[Workflow Run URL](${workflow_url})\n${pytest_logs}`; @@ -85,17 +84,17 @@ runs: // else update the body of the existing issue. if (result.search.edges.length === 0) { github.rest.issues.create({ - owner: owner, - repo: name, + owner: variables.owner, + repo: variables.name, body: issue_body, - title: title, - labels: [label], + title: variables.title, + labels: [variables.label], assignees: assignees }); } else { github.rest.issues.update({ - owner: owner, - repo: name, + owner: variables.owner, + repo: variables.name, issue_number: result.search.edges[0].node.number, body: issue_body }); From e8da665947a151c156e72d20b9305f939ead5b35 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:35:25 +0200 Subject: [PATCH 21/25] more semicolon --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index f2cec39..c5edd31 100644 --- a/action.yaml +++ b/action.yaml @@ -77,7 +77,7 @@ runs: label: "${{ inputs.issue-label }}", creator: "app/github-actions", title: "${{ inputs.issue-title }}" - } + }; const result = await github.graphql(query, variables); // If no issue is open, create a new issue, From 2e6d1273cadc75ef2f7cfdd17b52759d16db1fcc Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:38:00 +0200 Subject: [PATCH 22/25] try removing the braces --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index c5edd31..e2c9f46 100644 --- a/action.yaml +++ b/action.yaml @@ -58,7 +58,7 @@ runs: // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query($owner:String!, $name:String!, $creator:String!, $label:String!, $title:String!) { - search(query: "repo:${owner}/${name} author:${creator} label:${label} is:open in:title ${title}", type:ISSUE, first: 1) { + search(query: "repo:$owner/$name author:$creator label:$label is:open in:title $title", type:ISSUE, first: 1) { edges { node { ... on Issue { From 668cd13c2a14aaff601f9296152577001618f494 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:45:38 +0200 Subject: [PATCH 23/25] try doing the string interpolation in js --- action.yaml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/action.yaml b/action.yaml index e2c9f46..d779803 100644 --- a/action.yaml +++ b/action.yaml @@ -56,9 +56,18 @@ runs: const workflow_url = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; const issue_body = `[Workflow Run URL](${workflow_url})\n${pytest_logs}`; + const variables = { + owner: context.repo.owner, + name: context.repo.repo, + label: "${{ inputs.issue-label }}", + creator: "app/github-actions", + title: "${{ inputs.issue-title }}" + }; + const query_string = `repo:${variables.owner}/${variables.name} author:${variables.creator} label:${variables.label} in:title ${variables.title}`; + // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures - const query = `query($owner:String!, $name:String!, $creator:String!, $label:String!, $title:String!) { - search(query: "repo:$owner/$name author:$creator label:$label is:open in:title $title", type:ISSUE, first: 1) { + const query = `query { + search(query: ${query_string}, type:ISSUE, first: 1) { edges { node { ... on Issue { @@ -71,14 +80,7 @@ runs: } }`; - const variables = { - owner: context.repo.owner, - name: context.repo.repo, - label: "${{ inputs.issue-label }}", - creator: "app/github-actions", - title: "${{ inputs.issue-title }}" - }; - const result = await github.graphql(query, variables); + const result = await github.graphql(query); // If no issue is open, create a new issue, // else update the body of the existing issue. From 7d600bc1adb21fe173a7a82e558466aa6d3764b1 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:46:53 +0200 Subject: [PATCH 24/25] add back the quotes --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index d779803..f6660cb 100644 --- a/action.yaml +++ b/action.yaml @@ -67,7 +67,7 @@ runs: // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query { - search(query: ${query_string}, type:ISSUE, first: 1) { + search(query: "${query_string}", type:ISSUE, first: 1) { edges { node { ... on Issue { From 23b782ac382f753bd84a4f188cf0491111af85df Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sun, 7 Jul 2024 15:48:52 +0200 Subject: [PATCH 25/25] only search for open issues --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index f6660cb..1fa558a 100644 --- a/action.yaml +++ b/action.yaml @@ -63,7 +63,7 @@ runs: creator: "app/github-actions", title: "${{ inputs.issue-title }}" }; - const query_string = `repo:${variables.owner}/${variables.name} author:${variables.creator} label:${variables.label} in:title ${variables.title}`; + const query_string = `repo:${variables.owner}/${variables.name} author:${variables.creator} label:${variables.label} is:open in:title ${variables.title}`; // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures const query = `query {