Skip to content

Commit 781a878

Browse files
committed
Rebuild gh actions
1 parent 6efb4da commit 781a878

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • .github/actions/javascript/getPullRequestIncrementalChanges

.github/actions/javascript/getPullRequestIncrementalChanges/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12647,6 +12647,19 @@ class Git {
1264712647
throw new Error(`Failed to get file content from git: ${error instanceof Error ? error.message : String(error)}`);
1264812648
}
1264912649
}
12650+
/**
12651+
* Abbreviated hash for HEAD in the current working directory.
12652+
*
12653+
* @returns Short commit hash, or `unknown` when not a git repo or git fails.
12654+
*/
12655+
static getHeadShort() {
12656+
try {
12657+
return execSync('git rev-parse --short HEAD').trim();
12658+
}
12659+
catch {
12660+
return 'unknown';
12661+
}
12662+
}
1265012663
/**
1265112664
* Ensure a git reference is available locally, fetching it if necessary.
1265212665
*

0 commit comments

Comments
 (0)