diff --git a/.github/workflows/autoformat-push.yml b/.github/workflows/autoformat-push.yml new file mode 100644 index 0000000..7554790 --- /dev/null +++ b/.github/workflows/autoformat-push.yml @@ -0,0 +1,23 @@ +name: Autoformat code - push results +on: + workflow_run: + workflows: ["Autoformat code"] + types: + - completed + +permissions: + pull-requests: write + contents: write + +jobs: + push-and-notify: + name: Push autoformatted code and notify user + runs-on: ubuntu-latest + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + steps: + - name: 'Push autoformatted patch' + uses: rolfbjarne/autoformat-push@v0.1 + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml new file mode 100644 index 0000000..c87709d --- /dev/null +++ b/.github/workflows/autoformat.yml @@ -0,0 +1,17 @@ +name: Autoformat code +on: pull_request + +# This action only need a single permission in order to autoformat the code. +permissions: + contents: read + +jobs: + autoformat-code: + name: Autoformat code + runs-on: ubuntu-latest + + steps: + - name: 'Autoformat' + uses: rolfbjarne/autoformat@v0.1 + with: + projects: "Xamarin.MacDev.sln"