fix: fix the release awk for dep upgrades by feichashao · Pull Request #833 · openshift/backplane-cli

Thanks Siu Wa, tested as below:

git log $(git describe --tags --abbrev=0 v0.5.0)..upstream/main --pretty=format:"%h %s" |
gawk '
{
  hash = $1
  msg = substr($0, index($0, $2))

  # Skip merge commits (no real code changes)
  if (msg ~ /^Merge pull request/) {
    next
  }

  # Remove [TICKET] brackets → TICKET
  gsub(/\[([A-Za-z0-9_-]+)\]/, "\\1", msg)

  # Default category
  type = "others"

  # Detect bump commits first (dependency updates)
  if (msg ~ /[Bb]ump /) {
    type = "chore"
  }
  # Otherwise, detect type prefix (feat:, fix:, etc.)
  else if (match(msg, /(^|\s)([a-z]+)(\([^)]*\))?:/, m)) {
    detected = m[2]
    # Allow only known categories
    if (detected ~ /^(feat|fix|chore|docs|test)$/) {
      type = detected
    } else {
      type = "others"
    }
  }

  groups[type] = groups[type] "\n- " hash " " msg
}
END {
  order = "feat fix chore docs test others"
  split(order, o)
  for (i in o) {
    t = o[i]
    if (t in groups) {
      print "## " toupper(substr(t,1,1)) substr(t,2)
      print groups[t] "\n"
    }
  }
}
'  > /tmp/release-note.md

Now, the generated /tmp/release-note.md include the missing deps/chores

cat /tmp/release-note.md 
## Chore

- d668f32 build(deps): bump github.com/aws/aws-sdk-go-v2/config
- 441136a build(deps): bump github.com/aws/aws-sdk-go-v2/service/ssm
- 6dfd13a build(deps): bump github.com/aws/aws-sdk-go-v2/credentials
- 58e27f8 build(deps): bump sigs.k8s.io/kustomize/api from 0.20.1 to 0.21.0
- 5a6ae1b build(deps): bump github.com/aws/aws-sdk-go-v2/service/sts
- 5ac182e build(deps): bump github.com/onsi/ginkgo/v2 from 2.26.0 to 2.27.2
- 617b462 build(deps): bump github.com/aws/aws-sdk-go-v2/service/ssm
- 391901c build(deps): bump github.com/modelcontextprotocol/go-sdk
- 3399c56 build(deps): bump github.com/aws/aws-sdk-go-v2/service/sts
- 3d37a7b build(deps): bump github.com/aws/aws-sdk-go-v2/service/ssm
- da22e31 build(deps): bump github.com/openshift-online/ocm-sdk-go
- aeba8cc Bump backplane-api to the latest (#818)
- 1e3ec04 build(deps): bump github.com/aws/aws-sdk-go-v2/config

## Others

- 80fae2b OSD-28241: Allow building backplane config, login with provided OCM connections (#657)
- 4c1748a When constructing a client with a proxy, don't override the global http transport (#827)
- 8beb0d5 SREP-2441: Return the body of the error when backplane-api is unable to assume role (#825)
- b9529f6 Fix the ci/prow/images job failed
- 796418a Don't log INFO when retrieving backplane URL from config (#824)
- bd0c59c Migrate to golangci-lint v2 (#811)
- 8b1e423 Remove Hector Kemp from OWNERS (#812)
- 10f9afe Add jira token env var fallback (#810)

BTW, it would be great if contributors could follow the format defined in our CONTRIBUTING.md when setting PR titles, so commits can be grouped correctly for clearer release notes.