Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Show if a commit is signed #20

Open
Swordington opened this issue Dec 30, 2020 · 2 comments
Open

Feature - Show if a commit is signed #20

Swordington opened this issue Dec 30, 2020 · 2 comments

Comments

@Swordington
Copy link

While this may not be possible, it would be nice to check the signing status of a commit. This would would allow CI to automatically fail any unsigned commits, to check the overall security of a project, etc.

@titanism
Copy link
Contributor

@Swordington PR welcome! You could modify

last-commit-log/index.js

Lines 27 to 47 in 7f62323

const prettyFormat = [
'%h', '%H', '%s', '%f', '%b',
'%ct', '%cr', '%cn', '%ce',
'%at', '%ar', '%an', '%ae',
];
const splitCharacter = '<#__last-commit-log__#>';
const command = `git ${this.gitDirStr} log -1 --pretty=format:"` + prettyFormat.join(splitCharacter) + '"';
let c;
let gitRemote;
let gitBranch;
let gitTag;
try {
const opts = {
cwd: this.cwd,
maxBuffer: 1024 * 1024 * 1024,
// <https://stackoverflow.com/a/45578119
// <https://github.com/cabinjs/axe/issues/15>
stdio: 'pipe',
};
const stdout = execSync(command, opts).toString();
to have https://stackoverflow.com/a/32038784 and parse out GOOD/BAD etc.

@titanism
Copy link
Contributor

You could also have it run another command if that's easiest to get this as proof of concept.

https://git-scm.com/docs/git-verify-commit

But having one command do it all would be best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants