Skip to content

Commit f6c9d66

Browse files
TRT-315: Add commit history to release notes. (#54)
1 parent d9cab7f commit f6c9d66

File tree

5 files changed

+39
-13
lines changed

5 files changed

+39
-13
lines changed

.github/workflows/publish_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ jobs:
4040

4141
steps:
4242
- name: Checkout harmony-browse-image-generator repository
43-
uses: actions/checkout@v4
43+
uses: actions/checkout@v5
4444
with:
45-
lfs: true
45+
fetch-depth: 0
4646

4747
- name: Extract semantic version number
4848
run: echo "semantic_version=$(cat docker/service_version.txt)" >> $GITHUB_ENV

.github/workflows/run_lib_tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: Checkout harmony-browse-image-generator repository
17-
uses: actions/checkout@v4
18-
with:
19-
lfs: true
17+
uses: actions/checkout@v5
2018

2119
- name: Set up Python ${{ matrix.python-version }}
2220
uses: actions/setup-python@v5

.github/workflows/run_service_tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout harmony-browse-image-generator repository
19-
uses: actions/checkout@v4
20-
with:
21-
lfs: true
19+
uses: actions/checkout@v5
2220

2321
- name: Build service image
2422
run: ./bin/build-image

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ HyBIG follows semantic versioning. All notable changes to this project will be
44
documented in this file. The format is based on [Keep a
55
Changelog](http://keepachangelog.com/en/1.0.0/).
66

7-
## [2.4.1] - 2025-06-23
7+
## [vX.Y.Z] - Unreleased
8+
9+
### Changed
10+
11+
* GitHub release notes for HyBIG will now include the commit history for that
12+
release.
13+
14+
## [v2.4.1] - 2025-06-23
815

916
### Changed
1017

@@ -125,6 +132,7 @@ For more information on internal releases prior to NASA open-source approval,
125132
see legacy-CHANGELOG.md.
126133

127134
[unreleased]: https://github.com/nasa/harmony-browse-image-generator/
135+
[v2.4.1]: https://github.com/nasa/harmony-browse-image-generator/releases/tag/2.4.1
128136
[v2.4.0]: https://github.com/nasa/harmony-browse-image-generator/releases/tag/2.4.0
129137
[v2.3.0]: https://github.com/nasa/harmony-browse-image-generator/releases/tag/2.3.0
130138
[v2.2.0]: https://github.com/nasa/harmony-browse-image-generator/releases/tag/2.2.0

bin/extract-release-notes.sh

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# 2023-10-10: Copied from earthdata-varinfo repository to HOSS.
99
# 2024-01-03: Copied from HOSS repository to the Swath Projector.
1010
# 2024-01-23: Copied and modified from Swath Projector repository to HyBIG.
11+
# 2025-09-24: Append git commit messages to release notes.
1112
#
1213
###############################################################################
1314

@@ -19,13 +20,34 @@ CHANGELOG_FILE="CHANGELOG.md"
1920
VERSION_PATTERN="^## [\[]v"
2021

2122
## captures url links
22-
## [unreleased]:https://github.com/nasa/harmony-browse-image-generator/compare/1.2.0..HEAD
23-
## [v1.2.0]: https://github.com/nasa/harmony-browse-image-generator/compare/1.1.0..1.2.0
24-
LINK_PATTERN="^\[.*\].*\.\..*"
23+
## [v1.2.0]: https://github.com/nasa/harmony-browse-image-generator/releases/tags/1.2.0
24+
LINK_PATTERN="^\[.*\]:.*https://github.com/nasa"
2525

2626
# Read the file and extract text between the first two occurrences of the
2727
# VERSION_PATTERN
2828
result=$(awk "/$VERSION_PATTERN/{c++; if(c==2) exit;} c==1" "$CHANGELOG_FILE")
2929

30+
# Get all commit messages since the last release (marked with a git tag). If
31+
# there are no tags, get the full commit history of the repository.
32+
if [[ $(git tag) ]]
33+
then
34+
# There are git tags, so get the most recent one
35+
GIT_REF=$(git describe --tags --abbrev=0)
36+
else
37+
# There are not git tags, so get the initial commit of the repository
38+
GIT_REF=$(git rev-list --max-parents=0 HEAD)
39+
fi
40+
41+
# Retrieve the title line of all commit messages since $GIT_REF, filtering out
42+
# those from the pre-commit-ci[bot] author and any containing the string
43+
# "nasa/pre-commit-ci-update-config", which may result from merge commits.
44+
GIT_COMMIT_MESSAGES=$(git log --oneline --format="%s" --perl-regexp --author='^(?!pre-commit-ci\[bot\]).*$' --grep="nasa\/pre-commit-ci-update-config" --invert-grep ${GIT_REF}..HEAD)
45+
46+
# Append git commit messages to the release notes:
47+
if [[ ${GIT_COMMIT_MESSAGES} ]]
48+
then
49+
result+="\n\n## Commits\n\n${GIT_COMMIT_MESSAGES}"
50+
fi
51+
3052
# Print the result
31-
echo "$result" | grep -v "$VERSION_PATTERN" | grep -v "$LINK_PATTERN"
53+
echo -e "$result" | grep -v "$VERSION_PATTERN" | grep -v "$LINK_PATTERN"

0 commit comments

Comments
 (0)