7171 Write-Output "Package $PROJECT_NAME version set to $DEV_VERSION"
7272
7373 $dependencyMessage = @"
74- ## Development Package
75-
76- - Add this package as a dependency in your pyproject.toml:
74+ ### $PROJECT_NAME
7775
7876 ``````toml
7977 [project]
@@ -112,12 +110,23 @@ jobs:
112110 $currentBody = $pr.body
113111
114112 # Check if there's already a development package section
115- if ($currentBody -match '## Development Package') {
116- # Replace the existing section with the new dependency message
117- $newBody = $currentBody -replace '## Development Package(\r?\n|.)*?(?=##|$)', $dependencyMessage
113+ if ($currentBody -match '## Development Packages') {
114+ # Check if this specific package already has a section
115+ if ($currentBody -match "### $PROJECT_NAME") {
116+ # Replace the existing package section
117+ $newBody = $currentBody -replace "### $PROJECT_NAME(\r?\n|.)*?(?=###|##|$)", $dependencyMessage
118+ } else {
119+ # Append this package to the Development Packages section
120+ $newBody = $currentBody -replace '(## Development Packages)', "`$1`n`n$dependencyMessage"
121+ }
118122 } else {
119- # Append the dependency message to the end of the description
120- $newBody = if ($currentBody) { "$currentBody`n`n$dependencyMessage" } else { $dependencyMessage }
123+ # Create the Development Packages section with this package
124+ $packageSection = @"
125+ ## Development Packages
126+
127+ $dependencyMessage
128+ "@
129+ $newBody = if ($currentBody) { "$currentBody`n`n$packageSection" } else { $packageSection }
121130 }
122131
123132 # Update the PR description
@@ -127,7 +136,7 @@ jobs:
127136
128137 Invoke-RestMethod -Uri $prUri -Method Patch -Headers $headers -Body $updateBody -ContentType "application/json"
129138
130- Write-Output "Updated PR description with development package information"
139+ Write-Output "Updated PR description with development package information for $PROJECT_NAME "
131140
132141 - name : Build package
133142 run : uv build --package ${{ matrix.package.name }}
0 commit comments