13
0
Fork 0
mirror of https://github.com/dorny/paths-filter.git synced 2026-06-29 04:30:43 +00:00

fix: use rev-parse instead of branch --show-current for older git compat (#303)

This commit is contained in:
Sascha Bratton 2026-04-10 17:44:48 -04:00 committed by GitHub
parent 61f87a10cd
commit f3ceefdc7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

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
}