File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
set -Eeou pipefail
18
18
19
- : " ${AUTHOR:= $(git config user.name)} "
20
- : " ${VERSION:= $(git tag --list ' v*' --sort=-taggerdate | head -1 | cut -d ' v' -f 2)} "
21
- : " ${DATE:= $(date -u ' +%Y-%m-%d' )} "
19
+ : " ${TAG:= $(git tag --list ' v*' --sort=-taggerdate | head -1)} "
20
+ : " ${VERSION:= ${TAG# v} } "
21
+ : " ${AUTHOR:= $(git for-each-ref --format ' %(taggername)' " refs/tags/${TAG} " )} "
22
+ : " ${DATE:= $(git for-each-ref --format ' %(taggerdate:short)' " refs/tags/${TAG} " )} "
22
23
24
+ # Fallbacks in case tag is missing or doesn't have tagger metadata
25
+ AUTHOR=" ${AUTHOR:- Unknown Author} "
26
+ DATE=" ${DATE:- $(date -u ' +%Y-%m-%d' )} "
23
27
export AUTHOR VERSION DATE
24
28
25
29
REPORT_OUT=" ${REPORT_OUT:- ssdlc-compliance-report.md} "
26
30
echo " Generating SSDLC checklist for atlas-cli-plugin version ${VERSION} , author ${AUTHOR} , release date ${DATE} ..."
27
31
echo " Report will be part of the release: ${REPORT_OUT} "
28
32
29
- # Render the template with environment variable substitution
30
33
envsubst < docs/releases/ssdlc-compliance.template.md > " ${REPORT_OUT} "
You can’t perform that action at this time.
0 commit comments