Retarget vendor badges to release status#3103
Open
DRSDavidSoft wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the vendor-update GitHub Actions workflow to show build-status badges that are specifically associated with each vendor release tag in the autogenerated “Update vendored dependencies” PR table, with validation and a fallback when the official README badge can’t represent that release ref.
Changes:
- Add helpers to retarget common README badge patterns (GitHub Actions + Azure DevOps) to a release tag and set explicit alt text for release association.
- Validate retargeted badges by fetching the SVG and rejecting unusable states (e.g.,
no status,never built), falling back when needed. - Update vendor PR table generation to use the new release-aware badge selection logic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+303
to
307
| $RepoPath = $ReleaseInfo.RepoPath | ||
|
|
||
| try { | ||
| $readme = Invoke-GitHubApi -Uri "https://api.github.com/repos/$RepoPath/readme" | ||
| if ([string]::IsNullOrWhiteSpace($readme.content)) { |
Comment on lines
+229
to
+236
| if ($image -match '(?i)^https://dev\.azure\.com/.+/_apis/build/status' -or $target -match '(?i)^https://dev\.azure\.com/.+/_build/') { | ||
| if ($image -match '(?i)^https://dev\.azure\.com/.+/_apis/build/status') { | ||
| $image = Set-UrlQueryParameter -Url $image -Name 'branchName' -Value $tagName | ||
| $retargeted = $true | ||
| } | ||
| if ($target -match '(?i)^https://dev\.azure\.com/.+/_build/') { | ||
| $target = Set-UrlQueryParameter -Url $target -Name 'branchName' -Value $tagName | ||
| } |
602d670 to
75ea898
Compare
75ea898 to
b9ca48f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
—.Verification
git diff --check