Skip to content

Commit

Permalink
[GLUTEN-6915][CORE]Fix listComments TypeError (#6919)
Browse files Browse the repository at this point in the history
* Fix listComments TypeError

* Fix listComments in title_check.js

* fix typo.

* Update github rest

* add per_page

* fix

* enable debug

* remove debug
  • Loading branch information
weiting-chen committed Aug 20, 2024
1 parent 0e28d2c commit 38e39ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dev_cron/issues_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function haveComment(github, context, pullRequestNumber, body) {
page: 1
};
while (true) {
const response = await github.issues.listComments(options);
const response = await github.rest.issues.listComments(options);
if (response.data.some(comment => comment.body === body)) {
return true;
}
Expand All @@ -52,7 +52,7 @@ async function commentISSUESURL(github, context, pullRequestNumber, issuesID) {
if (await haveComment(github, context, pullRequestNumber, issuesURL)) {
return;
}
await github.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev_cron/title_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function haveISSUESID(title) {
}

async function commentOpenISSUESIssue(github, context, pullRequestNumber) {
const {data: comments} = await github.issues.listComments({
const {data: comments} = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber,
Expand All @@ -36,7 +36,7 @@ async function commentOpenISSUESIssue(github, context, pullRequestNumber) {
}
const commentPath = ".github/workflows/dev_cron/title_check.md";
const comment = fs.readFileSync(commentPath).toString();
await github.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber,
Expand Down

0 comments on commit 38e39ca

Please sign in to comment.