Skip to content

Commit 3889dde

Browse files
authored
Merge branch 'main' into DAS-2415
2 parents 1c5a89c + a12f1e0 commit 3889dde

5 files changed

Lines changed: 39 additions & 11 deletions

File tree

.github/workflows/publish_docker_image.yml

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

3737
steps:
3838
- name: Checkout harmony-metadata-annotator repository
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@v5
4040
with:
41-
lfs: true
41+
fetch-depth: 0
4242

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

.github/workflows/run_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-metadata-annotator repository
19-
uses: actions/checkout@v3
20-
with:
21-
lfs: true
19+
uses: actions/checkout@v5
2220

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

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
- id: check-yaml
1111
- id: check-added-large-files
1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.12.12
13+
rev: v0.13.1
1414
hooks:
1515
- id: ruff
1616
args: ["--fix", "--show-fixes"]

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Updates the units attribute on SMAP L3 timestamp variables to
1313
`seconds since 2000-01-01 11:58:55.816Z`.
1414

15+
## [vX.Y.Z] - Unreleased
16+
17+
### Changed
18+
19+
- Release notes for the Metadata Annotator will now include the commit history
20+
for that release.
21+
1522
## [v1.3.0] - 2025-09-16
1623

1724
### Changed

bin/extract-release-notes.sh

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
##################################################################################
33
#
4-
# Extract release notes for the latest version of Harmony CF Annotator service
4+
# 2025-02-20: Extract release notes for the latest version of Harmony Metadata
5+
# Annotator service
6+
# 2025-09-23: Append git commit messages to release notes.
57
#
68
##################################################################################
79

@@ -13,13 +15,34 @@ CHANGELOG_FILE="CHANGELOG.md"
1315
VERSION_PATTERN="^## [\[]v"
1416

1517
## captures url links
16-
## [unreleased]:https://github.com/nasa/harmony-cf-annotator/compare/1.2.0..HEAD
17-
## [v1.2.0]: https://github.com/nasa/harmony-cf-annotator/compare/1.1.0..1.2.0
18-
LINK_PATTERN="^\[.*\].*releases/tag/.*"
18+
## [v1.2.0]: https://github.com/nasa/harmony-metadata-annotator/releases/tags/1.2.0
19+
LINK_PATTERN="^\[.*\]:.*https://github.com/nasa"
1920

2021
# Read the file and extract text between the first two occurrences of the
2122
# VERSION_PATTERN
2223
result=$(awk "/$VERSION_PATTERN/{c++; if(c==2) exit;} c==1" "$CHANGELOG_FILE")
2324

25+
# Get all commit messages since the last release (marked with a git tag). If
26+
# there are no tags, get the full commit history of the repository.
27+
if [[ $(git tag) ]]
28+
then
29+
# There are git tags, so get the most recent one
30+
GIT_REF=$(git describe --tags --abbrev=0)
31+
else
32+
# There are not git tags, so get the initial commit of the repository
33+
GIT_REF=$(git rev-list --max-parents=0 HEAD)
34+
fi
35+
36+
# Retrieve the title line of all commit messages since $GIT_REF, filtering out
37+
# those from the pre-commit-ci[bot] author and any containing the string
38+
# "nasa/pre-commit-ci-update-config", which may result from merge commits.
39+
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)
40+
41+
# Append git commit messages to the release notes:
42+
if [[ ${GIT_COMMIT_MESSAGES} ]]
43+
then
44+
result+="\n\n## Commits\n\n${GIT_COMMIT_MESSAGES}"
45+
fi
46+
2447
# Print the result
25-
echo "$result" | grep -v "$VERSION_PATTERN" | grep -v "$LINK_PATTERN"
48+
echo -e "$result" | grep -v "$VERSION_PATTERN" | grep -v "$LINK_PATTERN"

0 commit comments

Comments
 (0)