format_push.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: Lint Format
  2. permissions:
  3. contents: read
  4. on:
  5. push:
  6. branches:
  7. - master
  8. - develop
  9. jobs:
  10. lint:
  11. runs-on: ubuntu-latest
  12. container: qmkfm/qmk_cli
  13. steps:
  14. - uses: actions/checkout@v3
  15. with:
  16. fetch-depth: 0
  17. - name: Disable automatic eol conversion
  18. run: |
  19. echo "* -text" > .git/info/attributes
  20. - name: Install dependencies
  21. run: |
  22. pip3 install -r requirements-dev.txt
  23. - name: Run qmk formatters
  24. shell: 'bash {0}'
  25. run: |
  26. qmk format-c -a
  27. qmk format-python -a
  28. qmk format-text -a
  29. git diff
  30. - uses: rlespinasse/github-slug-action@v3.x
  31. - name: Become QMK Bot
  32. run: |
  33. git config user.name 'QMK Bot'
  34. git config user.email 'hello@qmk.fm'
  35. - name: Create Pull Request
  36. uses: peter-evans/create-pull-request@v4
  37. if: ${{ github.repository == 'qmk/qmk_firmware'}}
  38. with:
  39. token: ${{ secrets.QMK_BOT_TOKEN }}
  40. delete-branch: true
  41. branch: bugfix/format_${{ env.GITHUB_REF_SLUG }}
  42. author: QMK Bot <hello@qmk.fm>
  43. committer: QMK Bot <hello@qmk.fm>
  44. commit-message: Format code according to conventions
  45. title: '[CI] Format code according to conventions'