Skip to content

Commit 72c0bfd

Browse files
janopaempdude
andcommitted
Improve documentation on why we use os.userInfo()
(use correct syscall name) Co-authored-by: Matthias Pigulla <[email protected]>
1 parent e3f1a8e commit 72c0bfd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

paths.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ const os = require('os');
22
const core = require('@actions/core');
33

44
const defaults = (process.env['OS'] != 'Windows_NT') ? {
5-
// Use getent() system call, since this is what ssh does; makes a difference in Docker-based
6-
// Action runs, where $HOME is different from the pwent
5+
// We use os.userInfo() rather than os.homedir(), since it uses the getpwuid() system call to get the user's home directory (see https://nodejs.org/api/os.html#osuserinfooptions).
6+
// This mimics the way openssh derives the home directory for locating config files (see https://github.com/openssh/openssh-portable/blob/826483d51a9fee60703298bbf839d9ce37943474/ssh.c#L710);
7+
// Makes a difference in Docker-based Action runs, when $HOME is different from what getpwuid() returns (which is based on the entry in /etc/passwd)
78
homePath: os.userInfo().homedir,
89
sshAgentCmdDefault: 'ssh-agent',
910
sshAddCmdDefault: 'ssh-add',

0 commit comments

Comments
 (0)