File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1212 name : Format Code
1313 # Run on 'macos' because Linux is missing the `ios` workload: https://github.com/dotnet/runtime/issues/85505
1414 # Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
15- runs-on : macos-15
15+ runs-on : windows-latest
1616 steps :
1717 - name : Checkout
1818 uses : actions/checkout@v4
4040 # we need to pass the current branch, otherwise we can't commit the changes.
4141 # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
4242 - name : Commit Formatted Code
43- run : ./scripts/commit-formatted-code.sh $GITHUB_HEAD_REF
43+ shell : pwsh
44+ run : pwsh ./scripts/commit-formatted-code.ps1 $GITHUB_HEAD_REF
Original file line number Diff line number Diff line change 1+ # Requires at least PowerShell 5.1 or PowerShell Core
2+
3+ param (
4+ [string ]$GITHUB_BRANCH
5+ )
6+
7+ $gitStatus = git status
8+
9+ if ($gitStatus -match " nothing to commit" ) {
10+ Write-Host " Nothing to commit. All code formatted correctly."
11+ } else {
12+ Write-Host " Formatted some code. Going to push the changes."
13+ git config -- global user.name ' Sentry Github Bot'
14+ git config
-- global user.email
' [email protected] ' 15+ git fetch
16+ git checkout $GITHUB_BRANCH
17+ git commit - am " Format code"
18+ git push -- set-upstream origin $GITHUB_BRANCH
19+ }
You can’t perform that action at this time.
0 commit comments