mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-08-14 17:30:50 +00:00
codereview: define a git-user slug instead of a true/false config
This commit is contained in:
parent
f3b199b7ed
commit
5fba9eb899
7 changed files with 32 additions and 14 deletions
|
@ -143,3 +143,15 @@ async function downloadArchive(
|
|||
})
|
||||
return Buffer.from(response.data as ArrayBuffer) // response.data is ArrayBuffer
|
||||
}
|
||||
|
||||
export async function getUserId(
|
||||
username: string,
|
||||
authToken: string,
|
||||
baseUrl?: string
|
||||
): Promise<number> {
|
||||
const octokit = github.getOctokit(authToken, {
|
||||
baseUrl: getServerApiUrl(baseUrl)
|
||||
})
|
||||
const user = await octokit.rest.users.getByUsername({username,});
|
||||
return user.data.id
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue