format.yaml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: Format Codebase
  2. on:
  3. push:
  4. branches:
  5. - master
  6. jobs:
  7. format:
  8. runs-on: ubuntu-latest
  9. container: qmkfm/base_container
  10. # protect against those who develop with their fork on master
  11. if: github.repository == 'qmk/qmk_firmware'
  12. steps:
  13. - uses: actions/checkout@v2
  14. with:
  15. token: ${{ secrets.API_TOKEN_GITHUB }}
  16. - name: Install dependencies
  17. run: |
  18. apt-get update && apt-get install -y dos2unix
  19. - name: Format files
  20. run: |
  21. bin/qmk cformat -a
  22. bin/qmk pyformat
  23. bin/qmk fileformat
  24. - name: Become QMK Bot
  25. run: |
  26. git config user.name 'QMK Bot'
  27. git config user.email 'hello@qmk.fm'
  28. - name: Create Pull Request
  29. uses: peter-evans/create-pull-request@v3
  30. with:
  31. delete-branch: true
  32. author: QMK Bot <hello@qmk.fm>
  33. committer: QMK Bot <hello@qmk.fm>
  34. commit-message: Format code according to conventions
  35. title: '[CI] Format code according to conventions'