mirror of
https://github.com/dorny/paths-filter.git
synced 2026-03-21 11:10:52 +00:00
fix: use rev-parse instead of branch --show-current for older git compat
This commit is contained in:
parent
fbd0ab8f3e
commit
08809b8c81
@ -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
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user