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 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 diff --git a/bin/extract-release-notes.sh b/bin/extract-release-notes.sh index 9e2c82b..8322869 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,27 @@ 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 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} ]] +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"