xamarin-macios/.github
Rolf Bjarne Kvinge 7908a319e6
[actions] Add GitHub action to automatically format code. (#15935)
Implement a GitHub action to automatically format our source code.

This is implemented in two steps:

1. A restricted action is used to check if the code has any formatting issues, and if so, creates a patch to fix the code.
2. Another action is used to commit and push the patch (and add a comment to the PR notifying the submitter about the problems found).

This is because the first action will call 'dotnet format', which might be insecure in that it can execute code from the repository. This is not safe in a context that is allowed to push commits (because there are secrets in the environment) - so anyone could create a PR that would be executed as a part of 'dotnet format' and then look for our secrets and make them public. The restricted action's environment does not have any secrets, and it's thus safe to execute random code.

The second action will only execute if the corresponding file is in main, so this PR need to be merged before this can be fully implemented, and as such I've made the autoformatting opt-in (by adding the `actions-enable-autoformat` label). Once everything is confirmed to work properly, it will become opt-out instead.

Also, for now only a very simple project is autoformatted (xibuild.csproj), but the
idea is to fix source code incrementally, and add to the list of projects/code
we autoformat.
2022-09-19 11:48:10 +02:00
..
workflows [actions] Add GitHub action to automatically format code. (#15935) 2022-09-19 11:48:10 +02:00
dependabot.yml chore: Included githubactions in the dependabot config (#15330) 2022-06-27 13:23:48 +02:00
fabricbot.json [FabricBot] Fix 'Write' & 'Admin' permission issue (#14829) 2022-04-26 11:35:03 -05:00
fabricbot_readme.md Add fabricbot readme. (#14801) 2022-04-22 07:59:07 +02:00