authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-09 14:52:56 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-09 14:52:56 -08:00
log118f1110067a4ab5cc3583ee0ab030f27f684300
tree8477ee5f7ba4b88ff986358fa37f954a1e275065
parentcada17e93b73be3cd083bd978290f8f1f029acfe

Create changelog.sh


1 files changed, 44 insertions(+), 0 deletions(-)

changelog.sh created+44
......@@ -0,0 +1,44 @@
1#!/usr/bin/env bash
2
3set -e
4
5read-log() {
6 git log --format=format:"%h%n%H%n%an%n%s%n%d%n"
7}
8
9hash_abrev=''
10hash=''
11author=''
12title=''
13
14c=0
15t=0
16read-log |
17while IFS= read -r lineVAR; do
18 if [[ "$c" == '0' ]]; then
19 hash_abrev="$lineVAR"
20 fi
21 if [[ "$c" == '1' ]]; then
22 hash="$lineVAR"
23 fi
24 if [[ "$c" == '2' ]]; then
25 author="$lineVAR"
26 fi
27 if [[ "$c" == '3' ]]; then
28 title="$lineVAR"
29 fi
30 if [[ "$c" == '4' ]]; then
31 if [ ! -z "$lineVAR" ]; then
32 t=$(($t+1))
33 fi
34 if [[ "$t" == '2' ]]; then
35 break
36 fi
37 echo "<li><a href='https://github.com/nektro/$CIRCLE_PROJECT_REPONAME/commit/$hash'>$hash_abrev</a> $title ($author)</li>"
38 fi
39 c=$(($c+1))
40 #
41 if [[ "$c" == '6' ]]; then
42 c=0
43 fi
44done