Rest endpoint to delete comments returning 404
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- github, github-actions, javascript
調査の方向性
Start with the workflow snippet in the issue and the linked GitHub REST documentation for deleting an issue comment. Compare the comment identifiers saved by gh pr view --json comments with the comment_id passed to github.rest.issues.deleteComment, then verify the documented request against the reported 404 response. Done means the conditional deletion works for the saved comments.
索引モデルが issue の本文から書いたものです。
説明
I am saving the output of a gh cli invocation as follows:
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,
.
.
.
- 主要言語
- TypeScript
- スター
- 5k
- フォーク
- 586
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
actions/github-script のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
actions/github-script#728 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
actions/github-script#727 · リアクション 1 件 ·
-
{ オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
actions/github-script#724 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
actions/github-script#723 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
actions/github-script#714 · コメント 1 件 · リアクション 4 件 ·