From ef24f2b5ff439ad81265231c4840aee31d85f704 Mon Sep 17 00:00:00 2001 From: Owen Littlejohns Date: Mon, 22 Sep 2025 12:30:36 -0400 Subject: [PATCH 1/4] TRT-635: Update release notes to include git commit messages. --- bin/extract-release-notes.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/bin/extract-release-notes.sh b/bin/extract-release-notes.sh index 9e2c82b..b2b6e69 100755 --- a/bin/extract-release-notes.sh +++ b/bin/extract-release-notes.sh @@ -10,6 +10,7 @@ # 2024-01-23: Copied and modified from Swath Projector repository to HyBIG. # 2025-07-15: Copied and modified from HyBIG to earthdata-hashdiff. # 2025-09-05: Copied and modified from earthdata-hashdiff to HGA. +# 2025-09-22: Append git commit messages to release notes. # ############################################################################### @@ -28,5 +29,26 @@ LINK_PATTERN="^\[.*\]:.*https://github.com/nasa" # VERSION_PATTERN result=$(awk "/$VERSION_PATTERN/{c++; if(c==2) exit;} c==1" "$CHANGELOG_FILE") +# Get all commit messages since the last release (marked with a git tag). If +# there are no tags, get the full commit history of the repository. +if [[ $(git tag) ]] +then + # There are git tags, so get the most recent one + GIT_REF=$(git describe --tags --abbrev=0) +else + # There are not git tags, so get the initial commit of the repository + GIT_REF=$(git rev-list --max-parents=0 HEAD) +fi + +# Retrieve the title line of all commit messages since $GIT_REF, filtering out +# those from the pre-commit-ci[bot] author. +GIT_COMMIT_MESSAGES=$(git log --oneline --format="%s" --perl-regexp --author='^(?!pre-commit-ci\[bot\]).*$' ${GIT_REF}..HEAD) + +# Append git commit messages to the release notes: +if [[ ${GIT_COMMIT_MESSAGES} ]] +then + result+="\n\n## Commits\n\n${GIT_COMMIT_MESSAGES}" +fi + # Print the result -echo "$result" | grep -v "$VERSION_PATTERN" | grep -v "$LINK_PATTERN" +echo -e "$result" | grep -v "$VERSION_PATTERN" | grep -v "$LINK_PATTERN" From b00228c4aa95543d5083973c1d980dc36b5fc72c Mon Sep 17 00:00:00 2001 From: Owen Littlejohns Date: Mon, 22 Sep 2025 14:56:49 -0400 Subject: [PATCH 2/4] TRT-635: Exclude merge commits from pre-commit-ci. --- bin/extract-release-notes.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/extract-release-notes.sh b/bin/extract-release-notes.sh index b2b6e69..8322869 100755 --- a/bin/extract-release-notes.sh +++ b/bin/extract-release-notes.sh @@ -41,8 +41,9 @@ else fi # Retrieve the title line of all commit messages since $GIT_REF, filtering out -# those from the pre-commit-ci[bot] author. -GIT_COMMIT_MESSAGES=$(git log --oneline --format="%s" --perl-regexp --author='^(?!pre-commit-ci\[bot\]).*$' ${GIT_REF}..HEAD) +# those from the pre-commit-ci[bot] author and any containing the string +# "nasa/pre-commit-ci-update-config", which may result from merge commits. +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) # Append git commit messages to the release notes: if [[ ${GIT_COMMIT_MESSAGES} ]] From be8b75e649dfaeb58ecddc076703eefc514f5558 Mon Sep 17 00:00:00 2001 From: Owen Littlejohns Date: Mon, 22 Sep 2025 16:47:24 -0400 Subject: [PATCH 3/4] TRT-635: Update GitHub checkout action to get tags. --- .github/workflows/publish_docker_image.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_docker_image.yml b/.github/workflows/publish_docker_image.yml index 9c9a99c..df3a9da 100644 --- a/.github/workflows/publish_docker_image.yml +++ b/.github/workflows/publish_docker_image.yml @@ -21,9 +21,10 @@ jobs: steps: - name: Checkout harmony-gdal-adapter repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: - lfs: true + fetch-depth: 0 + fetch-tags: true - name: Extract semantic version number run: echo "semantic_version=$(cat version.txt)" >> $GITHUB_ENV From 50addd38b0fa2cefa586f537d20995a2f3d1390b Mon Sep 17 00:00:00 2001 From: Owen Littlejohns Date: Mon, 22 Sep 2025 17:01:24 -0400 Subject: [PATCH 4/4] TRT-635: Update checkout action in other workflow. --- .github/workflows/run_tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 1d0d944..1e6173a 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -11,9 +11,7 @@ jobs: steps: - name: Checkout harmony-gdal-adapter repository - uses: actions/checkout@v4 - with: - lfs: true + uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5