Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

DeleteFile action results in 404 when file exists

Abierto
#371 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
28/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
github, github-actions, javascript, typescript
Área
api, devops

Línea de trabajo

Start with the getContent and deleteFile calls shown in the issue, then compare their path, branch, and SHA values with the working curl request. Check how github-script version 6.4 sends these parameters. Done means deletion succeeds on my_branch or the request mismatch is isolated and documented.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

question

Describe the bug
I am using the deleteFile action in one of my pipelines, the idea is to perform some cleanup after some tasks are successfully done. I am following the documentation of the method, I put all the required fields, but when is running I get a 404, file does not exist, even though the file is there. Is there something I am missing? when deleting using curl(same parameters) it works just fine. Unfortunately I can't share screenshots since is a private repo.

To Reproduce
Steps to reproduce the behavior:
I get the sha of the file I want to delete:

const file = await github.rest.repos.getContent({
                owner: context.repo.owner,
                repo: context.repo.repo,
                path: "${{ path1 }}/${{ path2 }}/file",
                ref: "my_branch"

and then I run the delete:

github.rest.repos.deleteFile({
                 owner: context.repo.owner,
                 repo: context.repo.repo,
                 path: "${{ path1 }}/${{ path2 }}/file",
                 message: "Delete file",
                 sha: file.data.sha,
                 branch: "my_branch"

Expected behavior
File is deleted on the specific branch.

Desktop (please complete the following information):

  • OS: Ubuntu

Additional context
I am using version 6.4

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de actions/github-script

Todos los issues de actions/github-script

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.