(ref: RepoRef)
| 141 | } |
| 142 | |
| 143 | export function getAuthHeaders(ref: RepoRef): Record<string, string> { |
| 144 | const token = localStorage.getItem(getAuthTokenKey(ref)); |
| 145 | if (!token) return {}; |
| 146 | if (ref.provider === "gitlab") { |
| 147 | return { "PRIVATE-TOKEN": token }; |
| 148 | } |
| 149 | return { Authorization: `token ${token}` }; |
| 150 | } |
| 151 | |
| 152 | export function getBranchesToTry(detectedBranch: string): string[] { |
| 153 | return Array.from(new Set([detectedBranch, ...DEFAULT_BRANCHES])); |
no test coverage detected