2020-12-10 17:01:51 +00:00
|
|
|
name: Format Codebase
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-02-14 19:51:07 +00:00
|
|
|
- develop
|
2020-12-10 17:01:51 +00:00
|
|
|
|
|
|
|
jobs:
|
2020-12-11 13:49:03 +00:00
|
|
|
format:
|
2020-12-10 17:01:51 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: qmkfm/base_container
|
|
|
|
|
|
|
|
# protect against those who develop with their fork on master
|
|
|
|
if: github.repository == 'qmk/qmk_firmware'
|
|
|
|
|
|
|
|
steps:
|
2021-02-14 19:51:07 +00:00
|
|
|
- uses: rlespinasse/github-slug-action@v3.x
|
|
|
|
|
2020-12-10 17:01:51 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-12-16 23:00:02 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.API_TOKEN_GITHUB }}
|
2020-12-10 17:01:51 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
apt-get update && apt-get install -y dos2unix
|
|
|
|
|
|
|
|
- name: Format files
|
|
|
|
run: |
|
2020-12-11 13:49:03 +00:00
|
|
|
bin/qmk cformat -a
|
2020-12-10 17:01:51 +00:00
|
|
|
bin/qmk pyformat
|
|
|
|
bin/qmk fileformat
|
|
|
|
|
2021-02-06 12:55:50 +00:00
|
|
|
- name: Become QMK Bot
|
|
|
|
run: |
|
|
|
|
git config user.name 'QMK Bot'
|
|
|
|
git config user.email 'hello@qmk.fm'
|
|
|
|
|
|
|
|
- name: Create Pull Request
|
|
|
|
uses: peter-evans/create-pull-request@v3
|
2020-12-10 17:01:51 +00:00
|
|
|
with:
|
2021-02-06 12:55:50 +00:00
|
|
|
delete-branch: true
|
2021-02-14 19:51:07 +00:00
|
|
|
branch: bugfix/format_${{ env.GITHUB_REF_SLUG }}
|
2021-02-06 12:55:50 +00:00
|
|
|
author: QMK Bot <hello@qmk.fm>
|
|
|
|
committer: QMK Bot <hello@qmk.fm>
|
|
|
|
commit-message: Format code according to conventions
|
|
|
|
title: '[CI] Format code according to conventions'
|