diff --git a/.github/workflows/fix-format.yml b/.github/workflows/fix-format.yml new file mode 100644 index 00000000000000..8388750e358244 --- /dev/null +++ b/.github/workflows/fix-format.yml @@ -0,0 +1,31 @@ +name: Fix formatting + +on: + pull_request: + types: [labeled] + +jobs: + fix-formatting: + runs-on: ubuntu-latest + if: ${{ github.event.label.name == 'fix:formatting' }} + steps: + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} + private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} + + - name: 'Checkout' + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + token: ${{ steps.generate-token.outputs.token }} + + - name: Fix formatting + run: make install-all && format-all + + - name: Commit and push + uses: EndBug/add-and-commit@v9 + with: + message: chore: fix formatting