File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,14 @@ runs:
7272
7373 issue = 0
7474 const repo = context.repo.owner + "/" + context.repo.repo
75- const issues = await github.rest.search.issuesAndPullRequests({
76- q: "label:" + process.env.GITHUB_REF_NAME + "+state:open+type:issue+repo:" + repo,
75+ const issues = await github.rest.issues.listForRepo({
76+ owner: context.repo.owner,
77+ repo: context.repo.repo,
78+ labels: [process.env.GITHUB_REF_NAME],
7779 })
78- if (issues.data.total_count > 1) {
80+ if (issues.data.length > 1) {
7981 core.setFailed("Found more than one issue with same label")
80- } else if (issues.data.total_count == 0) {
82+ } else if (issues.data.length == 0) {
8183 const response = await github.rest.issues.create({
8284 owner: context.repo.owner,
8385 repo: context.repo.repo,
8890 issue = response.data.number
8991 console.log("Created issue #" + issue)
9092 } else {
91- issue = issues.data.items [0].number
93+ issue = issues.data[0].number
9294 console.log("Found existing issue #" + issue)
9395 }
9496
You can’t perform that action at this time.
0 commit comments