Check GH token availability for Get-Changelog#25133
Merged
TravisEz13 merged 6 commits intomasterfrom Mar 7, 2025
Merged
Conversation
TravisEz13
reviewed
Mar 7, 2025
Comment on lines
372
to
380
| $IsGHCLIInstalled = $false | ||
| try { | ||
| & gh --version > $null 2>&1 | ||
| $IsGHCLIInstalled = $true | ||
| } catch { | ||
| Write-Error -Message "GitHub CLI is not installed. Please install it from https://cli.github.com/" | ||
| } | ||
|
|
||
| if ($IsGHCLIInstalled) { |
Member
There was a problem hiding this comment.
Suggested change
| $IsGHCLIInstalled = $false | |
| try { | |
| & gh --version > $null 2>&1 | |
| $IsGHCLIInstalled = $true | |
| } catch { | |
| Write-Error -Message "GitHub CLI is not installed. Please install it from https://cli.github.com/" | |
| } | |
| if ($IsGHCLIInstalled) { | |
| $IsGHCLIInstalled = $false | |
| if (Get-command -CommandType Application -Name gh -ErrorAction SilentlyContinue) { | |
| $IsGHCLIInstalled = $true | |
| } else { | |
| Write-Error -Message "GitHub CLI is not installed. Please install it from https://cli.github.com/" -ErrorAction Stop | |
| } | |
| if ($IsGHCLIInstalled) { |
TravisEz13
reviewed
Mar 7, 2025
tools/releaseTools.psm1
Outdated
| Write-Output "[${version}]: https://github.com/PowerShell/PowerShell/compare/${LastReleaseTag}...${ThisReleaseTag}`n" | ||
| } | ||
|
|
||
| function CheckForAuthToken { |
Member
There was a problem hiding this comment.
Suggested change
| function CheckForAuthToken { | |
| function Get-GHDefaultAuthToken { |
TravisEz13
reviewed
Mar 7, 2025
tools/releaseTools.psm1
Outdated
| ) | ||
|
|
||
| if(-not $Token) { | ||
| $Token = CheckForAuthToken |
Member
There was a problem hiding this comment.
Suggested change
| $Token = CheckForAuthToken | |
| $Token = Get-GHDefaultAuthToken |
added 2 commits
March 7, 2025 13:14
TravisEz13
reviewed
Mar 7, 2025
TravisEz13
approved these changes
Mar 7, 2025
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Contributor
|
📣 Hey @jshigetomi, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
jshigetomi
added a commit
that referenced
this pull request
Mar 12, 2025
Co-authored-by: Justin Chung <chungjustin@microsoft.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
pwshBot
pushed a commit
to pwshBot/PowerShell
that referenced
this pull request
Apr 11, 2025
Co-authored-by: Justin Chung <chungjustin@microsoft.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
9 tasks
SIRMARGIN
pushed a commit
to SIRMARGIN/PowerShell
that referenced
this pull request
Dec 12, 2025
Co-authored-by: Justin Chung <chungjustin@microsoft.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
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.
PR Summary
This pull request includes changes to the
tools/releaseTools.psm1file to improve the handling of GitHub authentication tokens in theGet-ChangeLogfunction. The most important changes include making theTokenparameter optional and adding a new function to check for an authentication token.Improvements to GitHub token handling:
Tokenparameter inGet-ChangeLogto be optional instead of mandatory.CheckForAuthTokenfunction that checks for an existing GitHub CLI token or prompts the user to enter one if not found.Get-ChangeLogto callCheckForAuthTokenif theTokenparameter is not provided, ensuring a token is available for GitHub API requests.PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.- [ ] Issue filed:
(which runs in a different PS Host).