Skip to content

Instantly share code, notes, and snippets.

@tormodfj
Created April 14, 2020 05:44
Show Gist options
  • Save tormodfj/7145368bcb11436ed5dd34b3a806215a to your computer and use it in GitHub Desktop.
Save tormodfj/7145368bcb11436ed5dd34b3a806215a to your computer and use it in GitHub Desktop.
# This will allow the job to only execute for Pull Request builds
condition: eq(variables['Build.Reason'], 'PullRequest')
steps:
- task: UseDotNet@2
displayName: 'Use .Net Core runtime 3.1.x'
inputs:
packageType: runtime
version: 3.1.x
- powershell: |
dotnet tool install XamlStyler.Console --tool-path "$(Agent.TempDirectory)"
&"$(Agent.TempDirectory)\xstyler" -r -d "$(Build.SourcesDirectory)"
if (git status --porcelain)
{
echo "##vso[task.logissue type=error] *** XAML differences were detected. Please ensure to execute XAML Styler on your XAML files ***"
exit 1
}
displayName: 'Execute XAML Styler'
# You can decide if builds should fail or continue without XAML Styler formatting
continueOnError: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment