You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

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