From 0a4f6f91fff6736838eb5f4a323f8fc9b59d984a Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Wed, 16 Nov 2022 00:56:28 -0300 Subject: [PATCH] Provide RepositoryBranch metadata for package As documented in nuget (https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets) you can provide not only the repo URL, type and commit, but also the branch. But this information is not populated by default by the SourceLink package, neither the ReproducibleBuilds (unless the PR at https://github.com/dotnet/reproducible-builds/pull/27 is merged). So just bring the code in that PR here until that's merged and shipped. Fixes #23 --- Directory.Build.props | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 08bcef1..62c110e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -85,7 +85,38 @@ true + + + pr$(GITHUB_REF.Replace('refs/pull/', '').Replace('/merge', '')) + $(GITHUB_REF.Replace('refs/heads/', '').Replace('refs/tags/', '')) + + $(BUILD_SOURCEBRANCH.Replace('refs/heads/', '').Replace('refs/tags/', '')) + + pr$(APPVEYOR_PULL_REQUEST_NUMBER) + $(APPVEYOR_REPO_TAG_NAME) + $(APPVEYOR_REPO_BRANCH) + + $(TEAMCITY_BUILD_BRANCH) + + pr$(TRAVIS_PULL_REQUEST) + $(TRAVIS_BRANCH) + + pr$(CIRCLE_PR_NUMBER) + $(CIRCLE_TAG) + $(CIRCLE_BRANCH) + + $(CI_COMMIT_TAG) + pr$(CI_MERGE_REQUEST_IID) + pr$(CI_EXTERNAL_PULL_REQUEST_IID) + $(CI_COMMIT_BRANCH) + + pr$(BUDDY_EXECUTION_PULL_REQUEST_NO) + $(BUDDY_EXECUTION_TAG) + $(BUDDY_EXECUTION_BRANCH) + + +