-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Auto-merge non-breaking vendor updates with improved messaging #3059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 19 commits
d61a4f7
be60888
4d21982
f2e8ae5
e64c0b1
bf90303
e6fea0b
fa2a34a
570b1d6
0f6584f
cd2c4ec
4911924
2cc1125
9cfff38
e598536
82f7fdd
1afbd4a
a475de2
400cdfe
10a0675
7b86263
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,9 +31,9 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Summary - Workflow started | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: pwsh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "## π¦ Update Vendor - Workflow Summary" >> $env:GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "## π¦ Vendor Update - Workflow Summary" >> $env:GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" >> $env:GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Checking for vendor dependency updates..." >> $env:GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Checking for vendor dependency updates..." >> $env:GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" >> $env:GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - id: make-changes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -46,52 +46,211 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Set-GHVariable -Name COUNT_UPDATED -Value $count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $newVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $listUpdated = "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $updateMessage = "| Name | Old Version | New Version |`n| :--- | ---- | ---- |`n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $updateMessage = "| Name | Old Version | New Version |`n| :--- | :---: | :---: |`n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $majorUpdates = @() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $singleDepName = "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $singleDepOldVersion = "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $singleDepNewVersion = "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach ($s in $newVersion) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $oldVersion = ($currentVersion | Where-Object {$_.name -eq $s.name}).version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($s.version -ne $oldVersion) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $repoUrl = ($repoUrl = $s.Url.Replace("/archive/", "/releases/")).Substring(0, $repoUrl.IndexOf("/releases/")) + "/releases" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Store single dependency info for messages (only if this is the only update) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($count -eq 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $singleDepName = $s.name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $singleDepOldVersion = $oldVersion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $singleDepNewVersion = $s.version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Determine change type and emoji | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $changeType = "unknown" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $emoji = "π" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $isMajor = $false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Handle versions with more than 4 parts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $oldVerStr = $oldVersion.Split('-')[0] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $newVerStr = $s.version.Split('-')[0] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Split by dots and take only numeric parts, first 4 max | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $oldParts = $oldVerStr.Split('.') | Where-Object { $_ -match '^\d+$' } | Select-Object -First 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $newParts = $newVerStr.Split('.') | Where-Object { $_ -match '^\d+$' } | Select-Object -First 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Ensure we have at least 2 parts (major.minor) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($oldParts.Count -ge 2 -and $newParts.Count -ge 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $oldVerParseable = $oldParts -join '.' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $newVerParseable = $newParts -join '.' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $oldVer = [System.Version]::Parse($oldVerParseable) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $newVer = [System.Version]::Parse($newVerParseable) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($newVer.Major -gt $oldVer.Major) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $changeType = "major" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $emoji = "π₯" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $isMajor = $true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } elseif ($newVer.Minor -gt $oldVer.Minor) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $changeType = "minor" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $emoji = "π" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $changeType = "patch" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $emoji = "β¬οΈ" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+94
to
+96
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | |
| $changeType = "patch" | |
| $emoji = "β¬οΈ" | |
| } elseif ($newVer -gt $oldVer) { | |
| $changeType = "patch" | |
| $emoji = "β¬οΈ" | |
| } else { | |
| $changeType = "unknown" | |
| $emoji = "π" |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version parsing logic is duplicated between the PowerShell script (lines 307-344) and the GitHub Actions workflow (lines 66-102). This duplication makes maintenance harder and increases the risk of inconsistencies. Consider extracting this logic into a reusable function in the PowerShell script that both locations can call.
| # Determine change type and emoji | |
| $changeType = "unknown" | |
| $emoji = "π" | |
| $isMajor = $false | |
| try { | |
| # Handle versions with more than 4 parts | |
| $oldVerStr = $oldVersion.Split('-')[0] | |
| $newVerStr = $s.version.Split('-')[0] | |
| # Split by dots and take only numeric parts, first 4 max | |
| $oldParts = $oldVerStr.Split('.') | Where-Object { $_ -match '^\d+$' } | Select-Object -First 4 | |
| $newParts = $newVerStr.Split('.') | Where-Object { $_ -match '^\d+$' } | Select-Object -First 4 | |
| # Ensure we have at least 2 parts (major.minor) | |
| if ($oldParts.Count -ge 2 -and $newParts.Count -ge 2) { | |
| $oldVerParseable = $oldParts -join '.' | |
| $newVerParseable = $newParts -join '.' | |
| $oldVer = [System.Version]::Parse($oldVerParseable) | |
| $newVer = [System.Version]::Parse($newVerParseable) | |
| if ($newVer.Major -gt $oldVer.Major) { | |
| $changeType = "major" | |
| $emoji = "π₯" | |
| $isMajor = $true | |
| } elseif ($newVer.Minor -gt $oldVer.Minor) { | |
| $changeType = "minor" | |
| $emoji = "π" | |
| } else { | |
| $changeType = "patch" | |
| $emoji = "β¬οΈ" | |
| } | |
| } | |
| } catch { | |
| $changeType = "unknown" | |
| $emoji = "π" | |
| } | |
| # Determine change type and emoji using shared function | |
| $result = Get-VersionChangeType -OldVersion $oldVersion -NewVersion $s.version | |
| $changeType = $result.ChangeType | |
| $emoji = $result.Emoji | |
| $isMajor = $result.IsMajor |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table row includes backticks around version numbers in markdown format, but the backtick for $oldVersion is escaped with a backslash (\$oldVersion``). This will likely render the backslash literally in the markdown output instead of showing just the backtick. The backslash should be removed to properly format the version number.
| $updateMessage += "| $emoji **[$($s.name)]($repoUrl)** | \`$oldVersion\` | **\`$($s.version)\`** |`n" | |
| $updateMessage += "| $emoji **[$($s.name)]($repoUrl)** | `$oldVersion` | **`$($s.version)`** |`n" |
DRSDavidSoft marked this conversation as resolved.
Show resolved
Hide resolved
DRSDavidSoft marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The auto-merge feature directly pushes to the master branch without any approval or security checks. This could be a security risk if a malicious dependency update is introduced. Consider adding validation steps before auto-merging, such as running tests or security scans, even for minor/patch updates.
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a potential race condition if multiple workflow runs execute concurrently. If two workflows try to push to master at the same time, one will fail. While this is handled by the error catch block, it would be better to use a concurrency group to prevent multiple instances of this workflow from running simultaneously on the same branch.
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The $commitResult variable captures the output of git commit, but it's only used in a check on line 224. However, if the commit fails (e.g., no changes to commit), the script will proceed to try to push, which could fail. Consider checking if the commit succeeded before attempting to push, or use -ErrorAction Stop to halt on errors.
| # Push directly to master | |
| git push origin HEAD:master | |
| echo "" >> $env:GITHUB_STEP_SUMMARY | |
| echo "β **Success!** Updates have been automatically merged to master." >> $env:GITHUB_STEP_SUMMARY | |
| echo "" >> $env:GITHUB_STEP_SUMMARY | |
| echo "**Updated dependencies:** $env:LIST_UPDATED" >> $env:GITHUB_STEP_SUMMARY | |
| # Set a flag to skip PR creation | |
| echo "AUTO_MERGED=true" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
| if ($commitResult) { | |
| # Push directly to master | |
| git push origin HEAD:master | |
| echo "" >> $env:GITHUB_STEP_SUMMARY | |
| echo "β **Success!** Updates have been automatically merged to master." >> $env:GITHUB_STEP_SUMMARY | |
| echo "" >> $env:GITHUB_STEP_SUMMARY | |
| echo "**Updated dependencies:** $env:LIST_UPDATED" >> $env:GITHUB_STEP_SUMMARY | |
| # Set a flag to skip PR creation | |
| echo "AUTO_MERGED=true" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
| } |
Outdated
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $headBeforeReset is set but never used. It appears to be intended for checking whether to reset the commit, but the logic doesn't actually use this variable. Consider removing it or implementing the intended logic to check if HEAD actually moved before attempting a reset.
| $headBeforeReset = git rev-parse HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Either implement the missing logic, or remove it. Where was this added, any why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in commit 10a0675. The variable was added in commit e64c0b1 as part of error handling logic with the intention to check if HEAD moved before resetting. However, it was never actually used - the code only checked $commitResult instead. Since the variable served no purpose, I removed it and simplified the comment to better reflect what the code actually does.
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error handling catches all exceptions but doesn't check if the git operations actually succeeded before attempting recovery. For example, if git add or git commit failed, the recovery logic may not work correctly. Additionally, the check if ($commitResult) on line 224 may not be reliable since $commitResult will contain the commit message output, not a boolean success indicator.
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition env.COUNT_UPDATED > 0 performs a string comparison instead of a numeric comparison. Environment variables in GitHub Actions are strings, so this should be written as env.COUNT_UPDATED != '0' to properly check if updates are available.
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expression env.COUNT_UPDATED == '1' in the format() function will not work as expected in GitHub Actions workflow expressions. In the context of workflow expressions (inside ${{ }}), you should use a simple comparison without env. prefix when comparing against string literals. The correct syntax should be: env.COUNT_UPDATED == 1 or use string comparison with quotes around the number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot The number of update should be wrapped in (`) like before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit 7b86263. The dependency count is now wrapped in backticks for the plural case to match the original format: π¦ Automatically updated {0} dependencies
DRSDavidSoft marked this conversation as resolved.
Show resolved
Hide resolved
DRSDavidSoft marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -259,6 +259,8 @@ function Fetch-DownloadUrl { | |||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| $count = 0 | ||||||||||||||||||||||||||||||||||||||||||
| $hasBreakingChanges = $false | ||||||||||||||||||||||||||||||||||||||||||
| $updateDetails = @() | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| # Read the current sources content | ||||||||||||||||||||||||||||||||||||||||||
| $sources = Get-Content $sourcesPath | Out-String | ConvertFrom-Json | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -301,6 +303,52 @@ foreach ($s in $sources) { | |||||||||||||||||||||||||||||||||||||||||
| # } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| $count++ | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| # Analyze version change type | ||||||||||||||||||||||||||||||||||||||||||
| $changeType = "unknown" | ||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||
| # Try parsing as semantic version | ||||||||||||||||||||||||||||||||||||||||||
| # Handle versions with more than 4 parts by taking only the first 3-4 parts | ||||||||||||||||||||||||||||||||||||||||||
| $oldVerStr = $s.version.Split('-')[0] | ||||||||||||||||||||||||||||||||||||||||||
| $newVerStr = $version.Split('-')[0] | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| # Split by dots and take only numeric parts, first 4 max | ||||||||||||||||||||||||||||||||||||||||||
| $oldParts = $oldVerStr.Split('.') | Where-Object { $_ -match '^\d+$' } | Select-Object -First 4 | ||||||||||||||||||||||||||||||||||||||||||
| $newParts = $newVerStr.Split('.') | Where-Object { $_ -match '^\d+$' } | Select-Object -First 4 | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| # Ensure we have at least 2 parts (major.minor) | ||||||||||||||||||||||||||||||||||||||||||
| if ($oldParts.Count -ge 2 -and $newParts.Count -ge 2) { | ||||||||||||||||||||||||||||||||||||||||||
| $oldVerParseable = $oldParts -join '.' | ||||||||||||||||||||||||||||||||||||||||||
| $newVerParseable = $newParts -join '.' | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| $oldVer = [System.Version]::Parse($oldVerParseable) | ||||||||||||||||||||||||||||||||||||||||||
| $newVer = [System.Version]::Parse($newVerParseable) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| if ($newVer.Major -gt $oldVer.Major) { | ||||||||||||||||||||||||||||||||||||||||||
| $changeType = "major" | ||||||||||||||||||||||||||||||||||||||||||
| $hasBreakingChanges = $true | ||||||||||||||||||||||||||||||||||||||||||
| } elseif ($newVer.Minor -gt $oldVer.Minor) { | ||||||||||||||||||||||||||||||||||||||||||
| $changeType = "minor" | ||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||
| $changeType = "patch" | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+327
to
+333
|
||||||||||||||||||||||||||||||||||||||||||
| if ($newVer.Major -gt $oldVer.Major) { | |
| $changeType = "major" | |
| $hasBreakingChanges = $true | |
| } elseif ($newVer.Minor -gt $oldVer.Minor) { | |
| $changeType = "minor" | |
| } else { | |
| $changeType = "patch" | |
| if ($newVer -lt $oldVer) { | |
| $changeType = "downgrade" | |
| $hasBreakingChanges = $true | |
| } elseif ($newVer.Major -gt $oldVer.Major) { | |
| $changeType = "major" | |
| $hasBreakingChanges = $true | |
| } elseif ($newVer.Minor -gt $oldVer.Minor) { | |
| $changeType = "minor" | |
| } elseif ($newVer.Build -gt $oldVer.Build) { | |
| $changeType = "patch" | |
| } else { | |
| # No version increase detected (could be equal or non-incremental change) | |
| $changeType = "unknown" |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When version parsing fails and falls into the catch block, the code sets $hasBreakingChanges = $true as a safety measure. However, this means that any dependency with a non-standard version format will always require manual review, even if it's actually a safe patch update. Consider logging which specific dependency failed to parse to help with debugging and potential future improvements to the version parsing logic.
| Write-Verbose "Could not parse version as semantic version, treating as potentially breaking" | |
| Write-Verbose "Could not parse version as semantic version for dependency '$($s.name)' (old: '$($s.version)', new: '$version'), treating as potentially breaking" |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UPDATE_DETAILS environment variable is exported as JSON but is never used in the workflow. If this was intended for future use or debugging, it should be documented. If it's not needed, it should be removed to avoid confusion and reduce the amount of data being passed through environment variables.
| Write-Output "UPDATE_DETAILS=$updateDetailsJson" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 |
Uh oh!
There was an error while loading. Please reload this page.