Closed pablosjv closed 3 years ago
Thanks again for creating a separate issue for this problem.
After a bit of testing I still can't exactly reproduce this error with the given workflow. (I've added the workflow in my test repo here. This correctly created a new file.)
However, I could reproduce the exact error message by following a post on programmer.help, which also explains, why this error happens: https://programmer.help/blogs/pathspec-master-did-not-match-any-files-known-to-git.html
In short: The git repository tries to switch to a branch, that previously might have existed, but had no commits inside of it. Running the following commands will raise the exact same error message:
mkdir issue-141
cd issue-141
git init
git checkout -b develop
touch a.txt
git add a.txt
git commit -m "Add new File"
git checkout master
As the error seems to be related with checking out the correct branch, I've now merged #140 and tagged a new version: v4.9.0. With #140 merged, the action will not automatically create the branch locally, if it doesn't exist yet.
@pablosjv As you seem to be able to reproduce this error, I would appreciate it if you could upgrade your workflow to v4.9.0 and test, if this resolves the error on your side as well.
If it does: great! 🎉 We can close this issue. If not, we would need a real GitHub repository with a workflow that reliably fails with this error message.
Thanks a lot @stefanzweifel for the quick response and feedback. Indeed revisiting the problem it was because I didn't have the branch master
in my repository. Instead I have the branch main
. This was a recently created repository and I guess Github now uses main
instead of master
. I was on autopilot and didn't see this, so my apologies.
Anyway, version v4.9.0 seems to work perfectly as it is creating the branch if it doesn't exists. From my side, we can close the issue.
Thanks for the update. Then let's close this issue. 🤙
Version of the Action
v4.8.0
Describe the bug
Setting the parameter
branch: maser
gives the following error:To Reproduce
To reproduce, setup the following workflow and run it. When the
branch: master
parameter is removed, the workflow works as expected.Used Workflow
Additional context
This problem seems to be related with the issue #6