-
-
Notifications
You must be signed in to change notification settings - Fork 294
Description
Bug description
The function hasAnyVersionTags in the Versioning class runs git through a call to System.run; unlike the more generic git function, which passes projectPath as the cwd parameter, hasAnyVersionTags does not - this breaks builds that check-out the repository to subfolders, since the git command will be run from a parent folder, which is not a git repository, and the call
will fail.
How to reproduce
- Create a build workflow that checks out to a different folder than the default (i.e. provide a path in the Checkout action, say call it 'project'),
- Provide that path above as the projectPath
- Build with the unity-builder action
Keeping all the defaults, the builder will make a call to hasAnyVersionTags and will fail due to the parent folder not being a repository
Expected behavior
Should behave exactly like the git function in Versioning, which passed projectPath as the cwd parameter to System.run.
Additional details
Why is this even important? Say you want to use custom actions in private git repositories - you then need to checkout the action. If you check it out into the game project's repository (i.e. under .github/actions) you're creating a "dirty" branch, which unity-builder will not build. So the best solution is to check the action out in a separate folder, which means checking out the project to a separate folder.
Solution is to add cwd to the call to System.run with projectPath.