-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathchangelog.sh
More file actions
executable file
·44 lines (40 loc) · 859 Bytes
/
changelog.sh
File metadata and controls
executable file
·44 lines (40 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -e
read-log() {
git log --format=format:"%h%n%H%n%an%n%s%n%d%n"
}
hash_abrev=''
hash=''
author=''
title=''
c=0
t=0
read-log |
while IFS= read -r lineVAR; do
if [[ "$c" == '0' ]]; then
hash_abrev="$lineVAR"
fi
if [[ "$c" == '1' ]]; then
hash="$lineVAR"
fi
if [[ "$c" == '2' ]]; then
author="$lineVAR"
fi
if [[ "$c" == '3' ]]; then
title="$lineVAR"
fi
if [[ "$c" == '4' ]]; then
if [ ! -z "$lineVAR" ]; then
t=$(($t+1))
fi
if [[ "$t" == '2' ]]; then
break
fi
echo "<li><a href='https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/commit/$hash'><code>$hash_abrev</code></a> $title ($author)</li>"
fi
c=$(($c+1))
#
if [[ "$c" == '6' ]]; then
c=0
fi
done