(rootDir: string)
| 78 | * In GitHub Actions push events, HEAD is often detached — prefer GITHUB_REF_NAME. |
| 79 | */ |
| 80 | export function detectReleaseBranch(rootDir: string): string | null { |
| 81 | const refName = process.env.GITHUB_REF_NAME; |
| 82 | const refType = process.env.GITHUB_REF_TYPE; |
| 83 | if (refName && refType !== 'tag') return refName; |
| 84 | const branch = getCurrentBranch({ cwd: rootDir }); |
| 85 | if (!branch || branch === 'HEAD') return null; // detached HEAD with no env hint |
| 86 | return branch; |
| 87 | } |
| 88 | |
| 89 | /** Find the channel matching a branch name, if any */ |
| 90 | export function matchChannelByBranch(config: BumpyConfig, branch: string | null): ResolvedChannel | null { |
no test coverage detected
searching dependent graphs…