We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6efb4da commit 781a878Copy full SHA for 781a878
1 file changed
.github/actions/javascript/getPullRequestIncrementalChanges/index.js
@@ -12647,6 +12647,19 @@ class Git {
12647
throw new Error(`Failed to get file content from git: ${error instanceof Error ? error.message : String(error)}`);
12648
}
12649
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
12663
/**
12664
* Ensure a git reference is available locally, fetching it if necessary.
12665
*
0 commit comments