File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 new_sha : ${{ steps.new_sha.outputs.sha }}
3131
3232 steps :
33+ - name : Setup .NET
34+ uses : actions/setup-dotnet@v4
35+ with :
36+ dotnet-version : " 10.0.x"
37+
3338 - name : Checkout project repo
3439 uses : actions/checkout@v4
3540 with :
@@ -146,12 +151,26 @@ jobs:
146151 jq ".cookiecutter.template_sha = \"${NEW_SHA}\"" \
147152 .cookiecutter.json > tmp.json && mv tmp.json .cookiecutter.json
148153
154+ #removed deprecated cookiecutter q & a
149155 python /tmp/template-source/hooks/prune_cookiecutter_json.py --cookie .cookiecutter.json --deprecations templates/deprecations.json
150156
151- git add -A
152- git commit -m "Template render at ${NEW_SHA}"
153-
154- TEMPLATE_COMMIT=$(git rev-parse HEAD)
157+ # Format .NET code to reduce whitespace-only churn in PRs
158+ # Try to format a solution if present; otherwise format the repo.
159+ SOLUTION="$(ls -1 *.slnx 2>/dev/null | head -n 1 || true)"
160+
161+ if [ -n "$SOLUTION" ]; then
162+ echo "🧼 Running dotnet format on $SOLUTION"
163+ dotnet restore "$SOLUTION"
164+ dotnet format "$SOLUTION" --no-restore
165+ else
166+ echo "🧼 Running dotnet format (no .slnx found at repo root)"
167+ dotnet format
168+ fi
169+
170+ git add -A
171+ git commit -m "Template render at ${NEW_SHA}"
172+
173+ TEMPLATE_COMMIT=$(git rev-parse HEAD)
155174
156175 # Switch back to repo branch and create update branch
157176 git checkout "${CURRENT_BRANCH}"
You can’t perform that action at this time.
0 commit comments