diff --git a/scripts/commit-json.sh b/scripts/commit-json.sh new file mode 100644 index 0000000000..6b7105254b --- /dev/null +++ b/scripts/commit-json.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +author_email=$(git log -1 --pretty=format:'%ae') +author_name=$(git log -1 --pretty=format:'%an') + +committer_email=$(git log -1 --pretty=format:'%ce') +committer_name=$(git log -1 --pretty=format:'%cn') + +commit_id=$(git rev-parse HEAD) +commit_title=$(git log -1 --pretty=%B | head -n 1) +commit_timestamp=$(git log -1 --format=%cd --date=iso-strict) +tree_id=$(git rev-parse --verify HEAD^{tree}) +repo_url=$(git config --get remote.origin.url | sed 's/git@github.com:/https:\/\/github.com\//' | sed 's/.git$//') # Convert to HTTPS format + +jq -c '.' > commit.json <