Febiunz / AzureDevOpsExtensionGitClone

Azure DevOps extension to Clone a Git repository
GNU General Public License v3.0
1 stars 2 forks source link

Output variables? #3

Closed araemo closed 4 years ago

araemo commented 4 years ago

Would it be possible to set an environment variable with the path to the checked out repo?

Something like: GitClone_RepoName = "D:\fully-qualified\path"

araemo commented 4 years ago

Here is a reference for output variables: https://github.com/Microsoft/azure-pipelines-agent/blob/master/docs/preview/outputvariable.md

araemo commented 4 years ago

Added a pull request that I think would do this. I think it would also work with Set-VstsTaskVariable instead of the write-host ##vso macro.

Febiunz commented 4 years ago

PR merged, copied line to other version also, updated version and published.

araemo commented 4 years ago

Thanks. I ran a test, and it does work, though not as I expected.

The variable, for the first gitclone task, for repo named "Repo.Name" ends up named: GITCLONE1_GITCLONE_REPO_NAME and for the second gitclone task, for a repo named "Another.Repo" it ends up as: GITCLONE2_GITCLONE_ANOTHER_REPO

So, we could probably remove the GitClone from the output line, since GITCLONE# gets prepended automatically by pipelines, and it just ends up being redundant.

Febiunz commented 4 years ago

Just published a new version with the new variable names as suggested. Thanx for testing! :)