github-action icon indicating copy to clipboard operation
github-action copied to clipboard

[BUG] Error on first run: "Error: Could not retrieve repository contents. Status: 404"

Open liffiton opened this issue 1 year ago • 7 comments

Describe the bug The first time a contributor triggered the workflow (v2.4.0) on a repository, the action failed before doing much of anything. The error message is "Error: Could not retrieve repository contents. Status: 404".

Here's an example in a clean repository with the Action installed simply by copy/pasting YAML from the action's Marketplace page: https://github.com/liffiton/testrepotest/actions/runs/9551059846

The error appears to come from SetupClaCheck.ts. However, I can't tell how the error is being thrown, because if error.status is 404, which the error message says it is, then the conditional should trigger the createClaFileAndPRComment() call instead. Maybe a type issue where error.status is a string for some reason?

To Reproduce Steps to reproduce the behavior:

  1. Create a new repository.
  2. Set up the workflow on that repository by copying the .yml file from contributor-assistant/github-action's README.
  3. Trigger the action with a new pull request on the repository.

liffiton avatar Jun 17 '24 16:06 liffiton

I'm encountering this same problem in my test repo as well:

https://github.com/nvzkupu/cla-test/actions/runs/9572474510/job/26391861486?pr=1

nvzkupu avatar Jun 18 '24 21:06 nvzkupu

same here, thanks for looking into it; I also noticed that when I close/reopen the pull request:

  • the workflow succeeds without any messages or apparent checking for signatures, unless I also add [reopened] to the types in the cla.yml
  • when I have added [reopened], the flow manages to lock the PR, but without any messages or apparent checking for signatures

tilorspace avatar Jun 24 '24 09:06 tilorspace

Same here. It works on existing repositories and fails on new repositories.

ronald-jaepel avatar Jun 24 '24 19:06 ronald-jaepel

I manually created a file for storing CLA Signatures as a workaround. https://github.com/arktwin/arktwin/commit/2d19501c66376d888b3574bc48a82f096308efbb

piyo7 avatar Jun 26 '24 00:06 piyo7

Also encountered with with v2.3.1 of the action.

cicdguy avatar Jul 11 '24 13:07 cicdguy

As @piyo7 mentioned, manually creating the signatures file solves the problem. The instructions specifically say not to create the file, so one possible fix would be to change the instructions.

bosconi avatar Aug 06 '24 13:08 bosconi

Any updates? I encountered the same problem.

liuzengh avatar Jul 21 '25 08:07 liuzengh