renovate/lib/modules/platform/util.ts
Philip 5fd8c2bd8b
refactor: Refactor azure (#17858)
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>
2022-09-19 13:37:14 +02:00

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;
}