-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathmake_release_notes.sh
executable file
·20 lines (14 loc) · 1.17 KB
/
make_release_notes.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
TMPFILE=`mktemp`
echo "# Added"
echo "SELECT '- \"' || get_ca_name_attribute(cac.CA_ID) || '\" (https://crt.sh/?sha256=' || upper(encode(digest(c.CERTIFICATE, 'sha256'), 'hex')) || ')' FROM certificate c, ca_certificate cac WHERE c.ID = cac.CERTIFICATE_ID AND digest(c.CERTIFICATE, 'sha256') IN (" > $TMPFILE
git show tsv/sabre-ca-roots.tsv | grep "^+" | grep -v "^+++" | sed "s/\t.*\$//g" | sed "s/^+/E'\\\\\\\\x/g" | sed "s/\$/',/g" >> $TMPFILE
echo "NULL) ORDER BY get_ca_name_attribute(cac.CA_ID);" >> $TMPFILE
psql -X -h crt.sh -p 5432 -d certwatch -U guest -f $TMPFILE | sed "s/^ //g"
echo
echo "# Removed"
echo "SELECT '- \"' || get_ca_name_attribute(cac.CA_ID) || '\" (https://crt.sh/?sha256=' || upper(encode(digest(c.CERTIFICATE, 'sha256'), 'hex')) || ')' FROM certificate c, ca_certificate cac WHERE c.ID = cac.CERTIFICATE_ID AND digest(c.CERTIFICATE, 'sha256') IN (" > $TMPFILE
git show tsv/sabre-ca-roots.tsv | grep "^-" | grep -v "^---" | sed "s/\t.*\$//g" | sed "s/^-/E'\\\\\\\\x/g" | sed "s/\$/',/g" >> $TMPFILE
echo "NULL) ORDER BY get_ca_name_attribute(cac.CA_ID);" >> $TMPFILE
psql -X -h crt.sh -p 5432 -d certwatch -U guest -f $TMPFILE | sed "s/^ //g"
rm $TMPFILE