INNER CODE UNIT · TypeScript
getUserInfo
EndBug/add-and-commit · src/util.ts:43
export async function getUserInfo(username?: string) {
if (!username) return undefined;
const octokit = getOctokitClient();
const res = await octokit.rest.users.getByUsername({username});
core.debug(
`Fetched github actor from the API: ${JSON.stringify(res?.data, null, 2)}`,
);
return {
name: res?.data?.name,
email: res?.data?.email,
};
}
/**
* Characters that can spoof or inject into CI logs when printed raw: