We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am saving the output of a gh cli invocation as follows:
gh
gh pr view ${{ github.event.number }} --json comments > comments.json
I then want to iterate on the saved comments and conditionally delete some of them,
- name: delete comments uses: actions/github-script@v6 with: result-encoding: string script: | const fs = require('fs'); const jsonData = JSON.parse(fs.readFileSync('comments.json', 'utf-8')); const comments = jsonData.comments; for (const cmnt of comments) { comment_id = cmnt.id if (cmnt.author.login == 'author-name' || cmnt.body == 'foo') { github.rest.issues.deleteComment({ owner: context.repo.owner, repo: context.repo.repo, comment_id: comment_id, }) } }
This fails with:
status: 404, response: { url: 'https://api.github.com/repos/MyOrganization/MyRepo/issues/comments/IC_kwDODse5xs5r1sLf', status: 404, . . .
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am saving the output of a
gh
cli invocation as follows:I then want to iterate on the saved comments and conditionally delete some of them,
This fails with:
The text was updated successfully, but these errors were encountered: