Rest endpoint to delete comments returning 404
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 42/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- github, github-actions, javascript
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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,
.
.
.
- Linguagem predominante
- TypeScript
- Estrelas
- 5k
- Forks
- 586
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de actions/github-script
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
actions/github-script#728 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 52/100
actions/github-script#727 · 1 reação ·
-
{ Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 10/100
actions/github-script#724 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
actions/github-script#723 · 1 comentário ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
actions/github-script#714 · 1 comentário · 4 reações ·
Todas as issues de actions/github-script
Issues semelhantes
-
blocklist removal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
pastelsky/bundlephobia#1122 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100