- Notifications
You must be signed in to change notification settings - Fork8.1k
Check GH token availability for Get-Changelog#25133
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| $IsGHCLIInstalled=$false | ||
| try { | ||
| & gh--version>$null2>&1 | ||
| $IsGHCLIInstalled=$true | ||
| }catch { | ||
| Write-Error-Message"GitHub CLI is not installed. Please install it from https://cli.github.com/" | ||
| } | ||
| if ($IsGHCLIInstalled) { |
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.
| $IsGHCLIInstalled=$false | |
| try { | |
| & gh--version>$null2>&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) { |
tools/releaseTools.psm1 Outdated
| Write-Output"[${version}]: https://github.com/PowerShell/PowerShell/compare/${LastReleaseTag}...${ThisReleaseTag}`n" | ||
| } | ||
| functionCheckForAuthToken { |
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.
| functionCheckForAuthToken { | |
| functionGet-GHDefaultAuthToken { |
tools/releaseTools.psm1 Outdated
| ) | ||
| if(-not$Token) { | ||
| $Token= CheckForAuthToken |
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.
| $Token=CheckForAuthToken | |
| $Token=Get-GHDefaultAuthToken |
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.
review comments
Uh oh!
There was an error while loading.Please reload this page.
/azp run |
| Azure Pipelines successfully started running 2 pipeline(s). |
14f8003 intomasterUh oh!
There was an error while loading.Please reload this page.
microsoft-github-policy-servicebot commentedMar 7, 2025 • edited by unfurl-linksbot
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by unfurl-linksbot
Uh oh!
There was an error while loading.Please reload this page.
📣 Hey@jshigetomi, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗https://aka.ms/PSRepoFeedback |
Co-authored-by: Justin Chung <chungjustin@microsoft.com>Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
Co-authored-by: Justin Chung <chungjustin@microsoft.com>Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
Uh oh!
There was an error while loading.Please reload this page.
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).