Skip to content

Commit

Permalink
🪲 [Fix]: Prevent connecting GitHub CLI for 'APP' authentication type (#…
Browse files Browse the repository at this point in the history
…310)

## Description

This pull request includes a small fix to the `Set-GitHubContext`
function ensuring that the `Connect-GitHubCli` command is only executed
if the `AuthType` of the context is not `APP`.

*
[`src/functions/private/Auth/Context/Set-GitHubContext.ps1`](diffhunk://#diff-600a257f8ea7acdd36413aef2daf597ab69dd5bb3c17ec7d6fed83e15f0af1d7R155-R158):
Added a condition to check if `AuthType` is not 'APP' before executing
`Connect-GitHubCli`.

## Type of change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [ ] 📖 [Docs]
- [x] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [ ] 🚀 [Feature]
- [ ] 🌟 [Breaking change]

## Checklist

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
  • Loading branch information
MariusStorhaug authored Feb 17, 2025
1 parent 8f0b520 commit ab7756a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/functions/private/Auth/Context/Set-GitHubContext.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ function Set-GitHubContext {
if ($contextObj['AuthType'] -eq 'IAT') {
Set-GitHubGitConfig -Context $contextObj['Name']
}
Connect-GitHubCli -Context $contextObj
if ($contextObj['AuthType'] -ne 'APP') {
Connect-GitHubCli -Context $contextObj
}
}
if ($PassThru) {
Get-GitHubContext -Context $($contextObj['Name'])
Expand Down

0 comments on commit ab7756a

Please sign in to comment.