Skip to content

Comments

[Issue #446] Fixes script to generate release notes#448

Merged
widal001 merged 1 commit intomainfrom
issue-446-fix-generate-release-notes-script
Dec 16, 2025
Merged

[Issue #446] Fixes script to generate release notes#448
widal001 merged 1 commit intomainfrom
issue-446-fix-generate-release-notes-script

Conversation

@widal001
Copy link
Collaborator

@widal001 widal001 commented Dec 16, 2025

Summary

Fixes how the validate-and-generate-release-notes.sh handles the option --previous-tag "" which was breaking the CD workflows that were triggered without providing a previous tag.

Changes proposed

What was added, updated, or removed in this PR.

  • Fixes validate-and-generate-release-notes.sh to skip over the --previous-tag option when passed an empty string ""
  • Improves code comments related to that parsing option

Context for reviewers

Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers. Explain how the changes were verified.

The script failed if it received --previous-tag "" as an option because the script only ignored the previous tag if it was omitted or received no argument. This updates the option parsing to also skip parsing the previous tag option when set to an empty string ""

Additional information

Screenshots, GIF demos, code examples or output to help show the changes working as expected.

Testing locally

  1. Recreate the issue on main by running this from the root of the repo. It should fail with Unknown option:
    .github/scripts/validate-and-generate-release-notes.sh \
       --prefix "@common-grants/cli@" \
       --config-file ".github/release-config/lib-cli.yml" \
       --release-tag "@common-grants/cli@0.2.4" \
       --previous-tag "" \
       --repository "HHS/simpler-grants-protocol" \
       --dry-run
    
  2. Checkout this PR branch and re-run the script, and it should pass with:
     ✓ Latest tag '@common-grants/cli@0.2.4' is valid
     Generating release notes for @common-grants/cli@0.2.4
     
     === DRY RUN MODE - Release notes preview ===
     Latest tag: @common-grants/cli@0.2.4
     Previous tag: 
     
     <!-- Release notes generated using configuration in .github/release-config/lib-cli.yml at @common-grants/cli@0.2.4 -->
     
     
     
     **Full Changelog**: https://github.com/HHS/simpler-grants-protocol/compare/common-grants-sdk@0.4.0...@common-grants/cli@0.2.4
     === End of preview ===
    
Screenshot 2025-12-16 at 9 34 19 AM

Testing with GitHub action

Here's a dry run with the CLI workflow.

Screenshot 2025-12-16 at 9 38 19 AM

And here's another test with the Py SDK workflow:

Screenshot 2025-12-16 at 9 40 35 AM

The script failed if it received `--previous-tag ""` as an option
because the script only ignored the previous tag if it was omitted or
received no argument. This updates the option parsing to also skip the
previous tag if it receives an empty string `""`
@widal001 widal001 requested a review from jcrichlake December 16, 2025 14:41
@widal001 widal001 merged commit 66e7909 into main Dec 16, 2025
7 checks passed
@widal001 widal001 deleted the issue-446-fix-generate-release-notes-script branch December 16, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Infra] Fix generate release notes script

2 participants