Skip to content

Commit ed90954

Browse files
authored
fix: ssdlc missing author inside report (#108)
1 parent c7f5471 commit ed90954

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

build/package/generate-ssdlc-report.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@
1616

1717
set -Eeou pipefail
1818

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}")}"
2223

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')}"
2327
export AUTHOR VERSION DATE
2428

2529
REPORT_OUT="${REPORT_OUT:-ssdlc-compliance-report.md}"
2630
echo "Generating SSDLC checklist for atlas-cli-plugin version ${VERSION}, author ${AUTHOR}, release date ${DATE}..."
2731
echo "Report will be part of the release: ${REPORT_OUT}"
2832

29-
# Render the template with environment variable substitution
3033
envsubst < docs/releases/ssdlc-compliance.template.md > "${REPORT_OUT}"

0 commit comments

Comments
 (0)