fix: use rev-parse instead of branch --show-current for older git compat

This commit is contained in:
Sascha Bratton 2026-03-15 14:24:13 -04:00
parent fbd0ab8f3e
commit 08809b8c81
No known key found for this signature in database

View File

@ -166,8 +166,8 @@ export async function listAllFilesAsAdded(): Promise<File[]> {
export async function getCurrentRef(): Promise<string> {
core.startGroup(`Get current git ref`)
try {
const branch = (await getExecOutput('git', ['branch', '--show-current'])).stdout.trim()
if (branch) {
const branch = (await getExecOutput('git', ['rev-parse', '--abbrev-ref', 'HEAD'])).stdout.trim()
if (branch && branch !== 'HEAD') {
return branch
}