I have a Pipelines (for yaml) repo and a Source (for product source) repo. The pipeline job does the work of cloning Sources for a build. This works - so long as "Don't sync sources" is checked in the pipeline / YAML / Get Sources (from Pipelines) tab. I'm to the point where I need to sync Pipelines for scripts that get dot-sourced by inline powershell.
I tried adding:
- checkout: self
persistCredentials: true
discussed in another thread, but that didn't help.
steps:
- powershell: |
$commit = git ls-remote $ENV:REPOURL $ENV:BRANCH
. "$(Build.SourcesDirectory)\PowerShell\awesome_stuff.ps1"
Start-Awesome -WorkingDirectory $(Agent.BuildDirectory) -CloningDirectory $ENV:CLONING_DIRECTORY -BranchName $ENV:BRANCH -RepositryUrl $ENV:REPOURL -Commit $commit
errorActionPreference: continue
displayName: "Run Awesome"
If I "Don't sync sources", awesome_stuff.ps1 doesn't exist.
If I do sync, git ls-remote
errors with:
fatal: could not read Username for 'https://proj.contoso.com': terminal prompts disabled
You cannot call a method on a null-valued expression.