format_push.yml 1.2 KB

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