Get the last tag at `HEAD~1` for generating release notes

Now that we're relying on a tag push for making releases, the latest tag at HEAD is the release we're currently making, and we want the previous tag.

(in the earlier release process, we generated the release notes *before* creating the tag)

(ignore-relnotes)

PiperOrigin-RevId: 874468315
Change-Id: I1deb413ff6db4803f6c2eaf51da80c287ca78183
diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml
index 704e6eb..6ff8d26 100644
--- a/.bazelci/presubmit.yml
+++ b/.bazelci/presubmit.yml
@@ -95,6 +95,7 @@
       - "git commit --allow-empty -m 'Fake init commit'"
       - "git tag -a 'fake-tag-for-testing' -m 'ignore'"
       - "git commit --allow-empty -m 'Fake commit message for testing'"
+      - "git tag -a 'fake-tag-for-testing2' -m 'ignore'"
     test_targets:
       - "//test:check_remote_jdk_configs_test"
       - "//test:check_remote_java_tools_configs_test"
diff --git a/distro/relnotes.bzl b/distro/relnotes.bzl
index 9d76230..9c0806a 100644
--- a/distro/relnotes.bzl
+++ b/distro/relnotes.bzl
@@ -5,7 +5,7 @@
         name = name,
         outs = [name + ".txt"],
         cmd = """
-              last_rel=$$(git describe --tags --abbrev=0)
+              last_rel=$$(git describe --tags --abbrev=0 HEAD~1)
               changelog=$$(/usr/bin/git log tags/$$last_rel..HEAD --format=oneline --invert-grep --grep 'ignore-relnotes' --)
               sha=$$(/usr/bin/sha256sum $(SRCS) | cut -d ' '  -f1)
               cat > $@ <<EOF