mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 00:56:26 +00:00
5fd8c2bd8b
Co-authored-by: whitesource-for-github-com[bot] <50673670+whitesource-for-github-com[bot]@users.noreply.github.com> Co-authored-by: whitesource-for-github-com[bot] <whitesource-for-github-com[bot]@users.noreply.github.com>
17 lines
462 B
TypeScript
17 lines
462 B
TypeScript
import hasha from 'hasha';
|
|
|
|
export function repoFingerprint(
|
|
repoId: number | string,
|
|
endpoint: string | undefined
|
|
): string {
|
|
const input = endpoint ? `${endpoint}::${repoId}` : `${repoId}`;
|
|
const fingerprint = hasha(input);
|
|
return fingerprint;
|
|
}
|
|
|
|
export function getNewBranchName(branchName?: string): string | undefined {
|
|
if (branchName && !branchName.startsWith('refs/heads/')) {
|
|
return `refs/heads/${branchName}`;
|
|
}
|
|
return branchName;
|
|
}
|