Created
August 3, 2017 08:11
-
-
Save lennybacon/56d9aeea218ca85a767ba42118e5bd0e to your computer and use it in GitHub Desktop.
Tell if the branch is a pull request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="15.0" DefaultTargets="TellIfBranchIsPullRequest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<BUILD_SOURCEBRANCH>refs/pull/1/merge</BUILD_SOURCEBRANCH> | |
<IsPullRequest Condition="$(BUILD_SOURCEBRANCH.IndexOf(`/pull/`)) != -1">true</IsPullRequest> | |
<IsPullRequest Condition="$(BUILD_SOURCEBRANCH.IndexOf(`/pull/`)) == -1">false</IsPullRequest> | |
</PropertyGroup> | |
<Target Name="TellIfBranchIsPullRequest"> | |
<Message Text="$(IsPullRequest)" /> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment