Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 [Feature]: Connect GitHub Cli when running in GitHub Actions (#309)
## Description This pull request introduces a new function for authenticating to GitHub CLI, updates the GitHub context setting logic, and modifies environment setup and tests for GitHub Actions. - Fixes #296 ### New Functionality: * [`src/functions/private/Auth/Cli/Connect-GithubCli.ps1`](diffhunk://#diff-d06cafae09da8bbafd8605a79dc841ed3968059c6ea62f0c71da84ace69430b8R1-R57): Added the `Connect-GitHubCli` function to authenticate to GitHub CLI using a secure token from the provided context. ### Context and Environment Updates: * [`src/functions/private/Auth/Context/Set-GitHubContext.ps1`](diffhunk://#diff-600a257f8ea7acdd36413aef2daf597ab69dd5bb3c17ec7d6fed83e15f0af1d7L151-R156): Modified the `Set-GitHubContext` function to call `Connect-GitHubCli` when the environment type is GitHub Actions. * [`src/loader.ps1`](diffhunk://#diff-b17ebb5f3e89448f10e276ebc16be89cfd487096b407cb2861690cecb1b66c2fR10-R11): Added logic to set the `GITHUB_HOST_NAME` environment variable based on the `GITHUB_SERVER_URL` for GitHub Actions runners. ### Testing Enhancements: * [`tests/GitHub.Tests.ps1`](diffhunk://#diff-0b1d9ba345a583adce874126c13d6edd3f789416bb9c4db5df1e18af3608554cR62): Updated the test for `Connect-GitHubAccount` to verify that the GitHub CLI authentication token is not empty. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ]⚠️ [Security fix] - [x] 🚀 [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