Rest endpoint to delete comments returning 404
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- github, github-actions, javascript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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,
.
.
.
- Lenguaje dominante
- TypeScript
- Estrellas
- 5k
- Forks
- 586
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de actions/github-script
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
actions/github-script#728 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
actions/github-script#727 · 1 reacción ·
-
{ Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
actions/github-script#724 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
actions/github-script#723 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
actions/github-script#714 · 1 comentario · 4 reacciones ·