mirror of
https://gitea.com/actions/dorny-paths-filter.git
synced 2026-03-24 21:58:21 +00:00
fix: use rev-parse instead of branch --show-current for older git compat
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user