Skip to content

Update Baselines

Update Baselines #1

name: Update Baselines
# This action can be run on-demand against a branch.
# It attempts to update the baseline files, and commits and pushes changes if there are any.
on:
workflow_dispatch:
jobs:
main:
name: Update Baselines
runs-on: ubuntu-latest
env:
# don't print dotnet logo
DOTNET_NOLOGO: true
# disable telemetry (reduces dotnet tool output in logs)
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
- name: Test
continue-on-error: true
run: dotnet test --filter "TestCategory=Baseline" -- 'TestRunParameters.Parameter(name="SetBaseLine", value="true")'
- name: Commit baselines
run: |
git config --global user.email "[email protected]"
git config --global user.name "Bicep Automation"
git add .
if ! git diff-index --quiet HEAD --; then
git commit -m "Update test baselines"
git push
fi