Skip to content

Build the project first before formatting #30233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: "Copilot Setup Steps"

on: workflow_dispatch
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
copilot-setup-steps:
Expand Down
31 changes: 30 additions & 1 deletion .github/workflows/dotnet-format-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
workflow_dispatch:
schedule:
- cron: 0 0 * * * # Every day at midnight (UTC)
pull_request:
paths:
- .github/workflows/dotnet-format-daily.yml

permissions:
pull-requests: write
Expand All @@ -25,8 +28,34 @@ jobs:
with:
dotnet-version: 9.x

- name: Run a pre-work build
shell: pwsh
continue-on-error: true
run: .\build.ps1

- name: Add the local .NET to the envvars (PATH, DOTNET_ROOT)
shell: pwsh
run: |
Add-Content -Path $env:GITHUB_PATH -Value "$env:GITHUB_WORKSPACE/.dotnet"
Add-Content -Path $env:GITHUB_ENV -Value "DOTNET_ROOT=$env:GITHUB_WORKSPACE/.dotnet"
Add-Content -Path $env:GITHUB_ENV -Value "DOTNET_INSTALL_DIR=$env:GITHUB_WORKSPACE/.dotnet"

- name: Ensure we are using the correct .NET
shell: pwsh
run: |
dotnet --version
dotnet --info
dotnet workload --info

- name: Reset tracked files to clean workspace
shell: bash
run: |
git reset --hard HEAD

- name: Run dotnet format
run: dotnet format .\Microsoft.Maui.sln --no-restore --exclude Templates/src --exclude-diagnostics CA1822
run: |
dotnet restore Microsoft.Maui.sln
dotnet format Microsoft.Maui.sln --exclude Templates/src --exclude-diagnostics CA1822

- name: Create Pull Request
uses: dotnet/actions-create-pull-request@v4
Expand Down
Loading