4141 $PROJECT_NAME = ($pyprojcontent | Select-String -Pattern '(?m)^\[(project|tool\.poetry)\][^\[]*?name\s*=\s*"([^"]*)"' -AllMatches).Matches[0].Groups[2].Value
4242 $CURRENT_VERSION = ($pyprojcontent | Select-String -Pattern '(?m)^\[(project|tool\.poetry)\][^\[]*?version\s*=\s*"([^"]*)"' -AllMatches).Matches[0].Groups[2].Value
4343
44+
4445 # Get PR number and run number with proper padding
4546 $PR_NUM = [int]"${{ github.event.pull_request.number }}"
4647 $PADDED_PR = "{0:D5}" -f [int]"${{ github.event.pull_request.number }}"
5960
6061 Write-Output "Package version set to $DEV_VERSION"
6162
63+ $startMarker = "<!-- DEV_PACKAGE_START -->"
64+ $endMarker = "<!-- DEV_PACKAGE_END -->"
65+
6266 $dependencyMessage = @"
67+ $startMarker
6368 ## Development Package
6469
70+ - Use ``uipath pack --nolock`` to get the latest dev build from this PR (requires version range).
6571 - Add this package as a dependency in your pyproject.toml:
6672
6773 ``````toml
8288
8389 [tool.uv.sources]
8490 $PROJECT_NAME = { index = "testpypi" }
91+
92+ [tool.uv]
93+ override-dependencies = [
94+ "$PROJECT_NAME>=$MIN_VERSION,<$MAX_VERSION",
95+ ]
8596 ``````
97+ $endMarker
8698 "@
8799
88100 # Get the owner and repo from the GitHub repository
@@ -100,10 +112,11 @@ jobs:
100112 $pr = Invoke-RestMethod -Uri $prUri -Method Get -Headers $headers
101113 $currentBody = $pr.body
102114
103- # Check if there's already a development package section
104- if ($currentBody -match '## Development Package') {
105- # Replace the existing section with the new dependency message
106- $newBody = $currentBody -replace '## Development Package(\r?\n|.)*?(?=##|$)', $dependencyMessage
115+ # Check if markers already exist in the PR description
116+ $markerPattern = "(?s)$([regex]::Escape($startMarker)).*?$([regex]::Escape($endMarker))"
117+ if ($currentBody -match $markerPattern) {
118+ # Replace everything between markers (including markers)
119+ $newBody = $currentBody -replace $markerPattern, $dependencyMessage
107120 } else {
108121 # Append the dependency message to the end of the description
109122 $newBody = if ($currentBody) { "$currentBody`n`n$dependencyMessage" } else { $dependencyMessage }
0 commit comments