Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $moduleRootPath = Split-Path -Path $PSScriptRoot -Parent
- . (Join-Path -Path $moduleRootPath -ChildPath 'Tests\Config\Settings.ps1')
- Import-Module -Name (Join-Path -Path $moduleRootPath -ChildPath 'PowerShellForGitHub.psd1') -Force
- if ([string]::IsNullOrEmpty($env:ciAccessToken))
- {
- $message = @(
- 'The tests are using the configuration settings defined in Tests\Config\Settings.ps1.',
- 'If you haven''t locally modified those values, your tests are going to fail since you',
- 'don''t have access to the default accounts referenced. If that is the case, you should',
- 'cancel the existing tests, modify the values to ones you have access to, call',
- 'Set-GitHubAuthentication to cache your AccessToken, and then try running the tests again.')
- Write-Warning -Message ($message -join [Environment]::NewLine)
- }
- else
- {
- $secureString = $env:ciAccessToken | ConvertTo-SecureString -AsPlainText -Force
- $cred = New-Object System.Management.Automation.PSCredential "<username is ignored>", $secureString
- Set-GitHubAuthentication -Credential $cred
- $script:ownerName = $env:ciOwnerName
- $script:organizationName = $env:ciOrganizationName
- Write-Warning -Message 'This run is being executed in the Azure Dev Ops environment.'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement