Skip to content

Commit

Permalink
Pipeline repository name (#4616)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisRumyantsev authored Feb 7, 2024
1 parent 7b66aa3 commit 0a4b00a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Agent.Worker/Build/BuildJobExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ public override void InitializeJobExtension(IExecutionContext executionContext,
executionContext.SetVariable(Constants.Variables.Build.RepoId, repoInfo.TriggeringRepository.Id);
}

// Repo containing the pipeline.
executionContext.SetVariable(Constants.Variables.Build.PipelineRepoName, executionContext.GetVariableValueOrDefault(Constants.Variables.Build.RepoName));

executionContext.SetVariable(Constants.Variables.Build.RepoName, repoInfo.TriggeringRepository.Properties.Get<string>(Pipelines.RepositoryPropertyNames.Name));
executionContext.SetVariable(Constants.Variables.Build.RepoProvider, ConvertToLegacyRepositoryType(repoInfo.TriggeringRepository.Type));
executionContext.SetVariable(Constants.Variables.Build.RepoUri, repoInfo.TriggeringRepository.Url?.AbsoluteUri);
Expand Down
2 changes: 2 additions & 0 deletions src/Microsoft.VisualStudio.Services.Agent/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ public static class Build
public static readonly string RepoGitSubmoduleCheckout = "build.repository.git.submodulecheckout";
public static readonly string RepoId = "build.repository.id";
public static readonly string RepoLocalPath = "build.repository.localpath";
public static readonly string PipelineRepoName = "pipeline.repository.name";
public static readonly string RepoName = "build.Repository.name";
public static readonly string RepoProvider = "build.repository.provider";
public static readonly string RepoTfvcWorkspace = "build.repository.tfvc.workspace";
Expand Down Expand Up @@ -562,6 +563,7 @@ public static class Task
Build.GatedRunCI,
Build.GatedShelvesetName,
Build.Number,
Build.PipelineRepoName,
Build.RepoClean,
Build.RepoGitSubmoduleCheckout,
Build.RepoId,
Expand Down

0 comments on commit 0a4b00a

Please sign in to comment.