Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

DeleteFile action results in 404 when file exists

オープン
#371 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
28/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
github, github-actions, javascript, typescript
領域
api, devops

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
5k
フォーク
586
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

actions/github-script のほかの issue

actions/github-script の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。