Add script to generate simple changelogs (#668)

This commit is contained in:
Chevdor
2021-10-15 17:42:21 +02:00
committed by GitHub
parent 0e01e633bb
commit 86ed61c694
3 changed files with 25 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
changelog.md
+13
View File
@@ -0,0 +1,13 @@
# Changelog
Currently, the changelog is built locally.
Run:
```
./changelog.sh <ref_since>
```
For instance:
```
./changelog.sh statemine_v4
```
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
REF1=$1
JSON=$(git log $REF1..HEAD \
--pretty=format:'{ "commit": "%H", "short_sha": "%h", "author": "%an", "date": "%ad", "message": "%s"},' \
$@ | \
perl -pe 'BEGIN{print "{ \"since\": \"'${REF1}'\", \"commits\": ["}; END{print "]}"}' | \
perl -pe 's/},]/}]/')
echo $JSON | tera --template templates/changelog.md --stdin | tee