Search code examples
bashgithub-actions

ls shows file, but nothing else can see it


I'm trying to run a nuget pack and push with a .nuspec file in a GitHub action, but nuget can't seem to find the file.

I've added a pwd, an ls, and a cat to try to debug the issue, but it seems that not even the cat can see it.

From my workflow file:

pwd
ls artifacts/*

NUSPEC_NAME=${{ matrix.nuspec }}
cat artifacts/${NUSPEC_NAME}

(I also have a previous run where I echoed matrix.nuspec, and it does have just the file name JsonSchema.Net.es.nuspec.)

Output:

/home/runner/work/json-everything/json-everything
JsonSchema.Net.es.nuspec
es
cat: artifacts/JsonSchema.Net.es.nuspec: No such file or directory

Maybe I'm crazy, but it seems that since ls artifacts/* is outputting

JsonSchema.Net.es.nuspec
es

(es is a folder) then the file artifacts/JsonSchema.Net.es.nuspec actually does exist. So why isn't cat seeing it?

I've been banging my head against this for a couple hours, and my brain is tired. Once I figure this out, I think the nuget commands will fall into place.


Solution

  • I would advise you to show everything you have on your system, using the simple command:

    find . -ls
    

    The -ls switch will make sure all information is shown, like file type, file or directory, ..., and using that information you might solve your issue.

    In case the situation is not clear yet, please edit your question, adding the result of the find command.