diff --git a/.github/workflows/issue-cleanup.yaml b/.github/workflows/issue-cleanup.yaml new file mode 100644 index 0000000000000..037cb911a146f --- /dev/null +++ b/.github/workflows/issue-cleanup.yaml @@ -0,0 +1,36 @@ +name: Cleanup issue comment + +on: + issues: + types: + - opened + +permissions: {} + +jobs: + issue_cleanup: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6 + with: + script: | + const comments = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + + console.log(comments); + if (comments.length > 0) { + const comment = comments[0]; + console.log(comment); + // const result = await octokit.rest.issues.updateComment({ + // owner: context.repo.owner, + // repo: context.repo.repo, + // comment_id: comment.id, + // body, + // }); + console.log(result) + }