-
Notifications
You must be signed in to change notification settings - Fork 390
Closed
Description
The git user setup is run before changing directories for cwd. This causes the action to fail if the root directory is not a git repo, even if the intended directory for the action is not the root.
Lines 17 to 34 in 5766bae
| let setupGitUser = core.getBooleanInput("setupGitUser"); | |
| if (setupGitUser) { | |
| console.log("setting git user"); | |
| await gitUtils.setupUser(); | |
| } | |
| console.log("setting GitHub credentials"); | |
| await fs.writeFile( | |
| `${process.env.HOME}/.netrc`, | |
| `machine github.com\nlogin github-actions[bot]\npassword ${githubToken}` | |
| ); | |
| const inputCwd = core.getInput("cwd"); | |
| if (inputCwd) { | |
| console.log("changing directory to the one given as the input"); | |
| process.chdir(inputCwd); | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels