Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d61a4f7
Initial plan
Copilot Dec 8, 2025
be60888
Improve vendor CI/CD workflow with better messaging and auto-merge
Copilot Dec 8, 2025
4d21982
Fix trailing spaces in vendor workflow YAML
Copilot Dec 8, 2025
f2e8ae5
Improve version parsing to handle complex version strings
Copilot Dec 8, 2025
e64c0b1
Fix git reset logic in auto-merge error handling
Copilot Dec 8, 2025
bf90303
Remove Change Type column and add collapsible changelog for major upd…
Copilot Dec 8, 2025
e6fea0b
Use single emoji and show dependency name/version for single updates
Copilot Dec 8, 2025
fa2a34a
Merge branch 'master' into copilot/improve-vendor-ci-cd-messaging
DRSDavidSoft Dec 15, 2025
570b1d6
Fix single dependency variable initialization to prevent CI failures
Copilot Dec 15, 2025
0f6584f
Improve variable initialization logic with better error handling
Copilot Dec 15, 2025
cd2c4ec
Update version change emojis: πŸ”₯ major, πŸš€ minor, ⬆️ patch
Copilot Dec 15, 2025
4911924
Make new version bold in dependency update table
Copilot Dec 15, 2025
2cc1125
Fix CodeQL workflow PowerShell string termination error
Copilot Dec 15, 2025
9cfff38
Fix CodeQL PowerShell syntax by using Write-Output instead of echo
Copilot Dec 15, 2025
e598536
Use PowerShell here-string for CodeQL summary to fix parser error
Copilot Dec 15, 2025
82f7fdd
Merge and use PowerShell here-string for CodeQL summary
Dec 15, 2025
1afbd4a
Use PowerShell here-string to fix CodeQL parser error (reverted previ…
Copilot Dec 15, 2025
a475de2
Remove temporary comment from CodeQL workflow
Copilot Dec 15, 2025
400cdfe
Update .github/workflows/vendor.yml
DRSDavidSoft Dec 15, 2025
10a0675
Remove unused $headBeforeReset variable
Copilot Dec 15, 2025
7b86263
Wrap dependency count in backticks for consistency
Copilot Dec 15, 2025
d495b06
fixes
daxgames Feb 22, 2026
f2bde61
Fix workflows
daxgames Feb 22, 2026
8c0e2c5
Fix workflow YAML
daxgames Feb 22, 2026
a6f0015
cleanup
daxgames Feb 22, 2026
1e2d8eb
fixes
daxgames Feb 28, 2026
ae3ed77
Merge remote-tracking branch 'upstream/master' into copilot/improve-v…
daxgames Feb 28, 2026
2ebb4f2
Merge pull request #3077 from cmderdev/master
DRSDavidSoft Apr 11, 2026
d11c564
resolve conflicts
DRSDavidSoft Apr 12, 2026
6924bcb
Log vendor semantic version parsing failure
DRSDavidSoft Apr 12, 2026
e4ab8fb
Check commitResult
DRSDavidSoft Apr 12, 2026
7fdae8e
Add concurrency group to prevent race conditions in vendor workflow
Copilot Apr 12, 2026
59ef29c
Use numeric comparison instead of string for COUNT_UPDATED in PR title
Copilot Apr 12, 2026
426d9e6
Ensure downgrades don't show up as updates
DRSDavidSoft Apr 12, 2026
d3df508
Make sure downgrades don't show up as updates
DRSDavidSoft Apr 12, 2026
09b0075
Merge branch 'master' into copilot/improve-vendor-ci-cd-messaging
DRSDavidSoft Apr 12, 2026
58ab797
Extract version parsing to shared function and improve error handling
Copilot Apr 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 115 additions & 12 deletions .github/workflows/vendor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,13 +46,50 @@ 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"
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated
$updateMessage = "| Name | Old Version | New Version | Change Type |`n| :--- | :---: | :---: | :---: |`n"
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"

# Determine change type and emoji
$changeType = "unknown"
$emoji = "πŸ”„"
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 = "⚠️"
} elseif ($newVer.Minor -gt $oldVer.Minor) {
$changeType = "minor"
$emoji = "✨"
} else {
$changeType = "patch"
$emoji = "πŸ›"
}
}
} catch {
$changeType = "unknown"
$emoji = "πŸ”„"
}

$listUpdated += "$($s.name) v$($s.version), "
$updateMessage += "| **[$($s.name)]($repoUrl)** | $oldVersion | **$($s.version)** |`n"
$updateMessage += "| $emoji **[$($s.name)]($repoUrl)** | \`$oldVersion\` | \`$($s.version)\` | $changeType |`n"
}
}
if ($count -eq 0) { return }
Expand All @@ -66,32 +103,92 @@ jobs:
if ($count -eq 0) {
echo "### βœ… No Updates Available" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "All vendor dependencies are up to date." >> $env:GITHUB_STEP_SUMMARY
echo "All vendor dependencies are up to date! πŸŽ‰" >> $env:GITHUB_STEP_SUMMARY
} else {
$word = if ($count -eq 1) { 'dependency' } else { 'dependencies' }
$emoji = if ($count -eq 1) { 'πŸ“¦' } else { 'πŸ“¦πŸ“¦' }
echo "### πŸ”„ Updates Found" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "**$count** vendor $word updated:" >> $env:GITHUB_STEP_SUMMARY
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated
echo "$emoji **$count** vendor $word updated:" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "$env:UPDATE_MESSAGE" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY

# Check if we can auto-merge (only minor/patch changes)
$hasBreaking = $env:HAS_BREAKING_CHANGES -eq 'True'
if ($hasBreaking) {
echo "> ⚠️ **Note:** This update contains major version changes that may include breaking changes." >> $env:GITHUB_STEP_SUMMARY
} else {
echo "> ℹ️ **Note:** This update only contains minor or patch changes." >> $env:GITHUB_STEP_SUMMARY
}
}

- name: Auto-merge minor updates
if: env.COUNT_UPDATED > 0 && env.HAS_BREAKING_CHANGES != 'True'
Comment thread
DRSDavidSoft marked this conversation as resolved.
shell: pwsh
run: |
try {
echo "### πŸš€ Auto-merging Updates" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "Attempting to automatically merge non-breaking changes to master..." >> $env:GITHUB_STEP_SUMMARY

git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

# Commit the changes
git add vendor/sources.json
$commitResult = git commit -m "⬆️ Update dependencies ($env:LIST_UPDATED)"

# Push directly to master
git push origin HEAD:master
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated

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
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated
} catch {
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "⚠️ **Warning:** Unable to automatically merge updates." >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "**Error:** $($_.Exception.Message)" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "Falling back to creating a pull request..." >> $env:GITHUB_STEP_SUMMARY

Write-Warning "Failed to auto-merge: $($_.Exception.Message)"

# Reset only if a commit was made (check if HEAD moved)
$headBeforeReset = git rev-parse HEAD
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated
if ($commitResult) {
git reset --hard HEAD~1
}
Comment on lines +221 to +241
Copy link

Copilot AI Dec 15, 2025

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 uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved in commit 58ab797. The error handling now:

  • Checks exit codes with $LASTEXITCODE after git operations
  • Tracks success state for commit and push separately ($commitSuccess, $pushSuccess)
  • Only resets the commit if it succeeded but the push failed
  • Includes proper error messages with exit codes
  • Wraps reset operation in try-catch to handle reset failures gracefully


# Set flag to create PR instead
echo "AUTO_MERGED=false" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
}

- uses: peter-evans/create-pull-request@v7
if: env.COUNT_UPDATED > 0
if: env.COUNT_UPDATED > 0 && (env.HAS_BREAKING_CHANGES == 'True' || env.AUTO_MERGED == 'false')
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated
with:
title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies'
title: ${{ env.COUNT_UPDATED == '1' && format('⬆️ Update {0}', env.LIST_UPDATED) || format('⬆️ Update {0} vendored dependencies', env.COUNT_UPDATED) }}
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated
body: |
### Automatically updated `${{ env.COUNT_UPDATED }}` dependencies:
Comment thread
DRSDavidSoft marked this conversation as resolved.
### ${{ env.COUNT_UPDATED == '1' && 'πŸ“¦ Automatically updated 1 dependency' || format('πŸ“¦ Automatically updated {0} dependencies', env.COUNT_UPDATED) }}

${{ env.UPDATE_MESSAGE }}

---
Please verify and then **Merge** the pull request to update.

${{ env.HAS_BREAKING_CHANGES == 'True' && '⚠️ **This update contains major version changes that may include breaking changes.**' || 'ℹ️ This update only contains minor or patch changes.' }}

Please verify and then **Merge** the pull request to apply the updates.
commit-message: '⬆️ Update dependencies (${{ env.LIST_UPDATED }})'
branch: update-vendor
base: master

- name: Summary - Pull request created
if: env.COUNT_UPDATED > 0
if: env.COUNT_UPDATED > 0 && (env.HAS_BREAKING_CHANGES == 'True' || env.AUTO_MERGED == 'false')
Comment thread
DRSDavidSoft marked this conversation as resolved.
shell: pwsh
run: |
echo "### πŸŽ‰ Pull Request Created" >> $env:GITHUB_STEP_SUMMARY
Expand All @@ -102,4 +199,10 @@ jobs:
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "**Updated dependencies:** $env:LIST_UPDATED" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "> Please review and merge the pull request to apply the updates." >> $env:GITHUB_STEP_SUMMARY
if ($env:HAS_BREAKING_CHANGES -eq 'True') {
echo "> ⚠️ **Manual review required:** This update contains major version changes." >> $env:GITHUB_STEP_SUMMARY
} else {
echo "> ℹ️ **Note:** Auto-merge failed, manual review required." >> $env:GITHUB_STEP_SUMMARY
}
echo "" >> $env:GITHUB_STEP_SUMMARY
echo "Please review and merge the pull request to apply the updates." >> $env:GITHUB_STEP_SUMMARY
60 changes: 56 additions & 4 deletions scripts/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 thread
DRSDavidSoft marked this conversation as resolved.
Outdated
}
} else {
# Not enough numeric parts for semantic versioning
throw "Not enough numeric version parts"
}
} catch {
# If semantic versioning fails, treat as unknown (potentially breaking)
$changeType = "unknown"
$hasBreakingChanges = $true
Write-Verbose "Could not parse version as semantic version, treating as potentially breaking"
Comment thread
DRSDavidSoft marked this conversation as resolved.
Outdated
}

$updateDetails += @{
name = $s.name
oldVersion = $s.version
newVersion = $version
changeType = $changeType
}
}

$s.url = $downloadUrl
Expand All @@ -314,12 +362,16 @@ if ($count -eq 0) {
return
}

if ($Env:APPVEYOR -eq 'True') {
Add-AppveyorMessage -Message "Successfully updated $count dependencies." -Category Information
}

# Export update details for GitHub Actions
if ($Env:GITHUB_ACTIONS -eq 'true') {
$updateDetailsJson = $updateDetails | ConvertTo-Json -Compress
Write-Output "UPDATE_DETAILS=$updateDetailsJson" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
Comment thread
DRSDavidSoft marked this conversation as resolved.
Write-Output "HAS_BREAKING_CHANGES=$hasBreakingChanges" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
Write-Output "::notice title=Task Complete::Successfully updated $count dependencies."
}

if ($Env:APPVEYOR -eq 'True') {
Add-AppveyorMessage -Message "Successfully updated $count dependencies." -Category Information
}

Write-Host -ForegroundColor green "Successfully updated $count dependencies."