mirror of
https://github.com/actions/checkout.git
synced 2025-03-31 05:20:06 +02:00
log commit sha as well
This commit is contained in:
parent
0e8d9f459e
commit
8940ec9519
3 changed files with 15 additions and 8 deletions
9
dist/index.js
vendored
9
dist/index.js
vendored
|
@ -5883,9 +5883,10 @@ class GitCommandManager {
|
||||||
yield this.execGit(['lfs', 'install', '--local']);
|
yield this.execGit(['lfs', 'install', '--local']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
log1() {
|
log1(format) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const output = yield this.execGit(['log', '-1'], false, true);
|
var args = format ? ['log', '-1', format] : ['log', '-1'];
|
||||||
|
const output = yield this.execGit(args, false, true);
|
||||||
return output.stdout;
|
return output.stdout;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -6268,8 +6269,10 @@ function getSource(settings) {
|
||||||
yield authHelper.removeGlobalAuth();
|
yield authHelper.removeGlobalAuth();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Dump some info about the checked out commit
|
// Get commit information
|
||||||
const commitInfo = yield git.log1();
|
const commitInfo = yield git.log1();
|
||||||
|
// Log commit sha
|
||||||
|
yield git.log1("--format='%H'");
|
||||||
// Check for incorrect pull request merge commit
|
// Check for incorrect pull request merge commit
|
||||||
yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
|
yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ export interface IGitCommandManager {
|
||||||
isDetached(): Promise<boolean>
|
isDetached(): Promise<boolean>
|
||||||
lfsFetch(ref: string): Promise<void>
|
lfsFetch(ref: string): Promise<void>
|
||||||
lfsInstall(): Promise<void>
|
lfsInstall(): Promise<void>
|
||||||
log1(): Promise<string>
|
log1(format?: string): Promise<string>
|
||||||
remoteAdd(remoteName: string, remoteUrl: string): Promise<void>
|
remoteAdd(remoteName: string, remoteUrl: string): Promise<void>
|
||||||
removeEnvironmentVariable(name: string): void
|
removeEnvironmentVariable(name: string): void
|
||||||
revParse(ref: string): Promise<string>
|
revParse(ref: string): Promise<string>
|
||||||
|
@ -254,8 +254,9 @@ class GitCommandManager {
|
||||||
await this.execGit(['lfs', 'install', '--local'])
|
await this.execGit(['lfs', 'install', '--local'])
|
||||||
}
|
}
|
||||||
|
|
||||||
async log1(): Promise<string> {
|
async log1(format?: string): Promise<string> {
|
||||||
const output = await this.execGit(['log', '-1'], false, true)
|
var args = format ? ['log', '-1', format] : ['log', '-1']
|
||||||
|
const output = await this.execGit(args, false, true)
|
||||||
return output.stdout
|
return output.stdout
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,8 +201,11 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dump some info about the checked out commit
|
// Get commit information
|
||||||
const commitInfo = await git.log1()
|
const commitInfo = await git.log1();
|
||||||
|
|
||||||
|
// Log commit sha
|
||||||
|
await git.log1("--format='%H'");
|
||||||
|
|
||||||
// Check for incorrect pull request merge commit
|
// Check for incorrect pull request merge commit
|
||||||
await refHelper.checkCommitInfo(
|
await refHelper.checkCommitInfo(
|
||||||
|
|
Loading…
Add table
Reference in a new issue