2020-12-10 23:01:51 +06:00
|
|
|
name: Format Codebase
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-02-15 01:51:07 +06:00
|
|
|
- develop
|
2020-12-10 23:01:51 +06:00
|
|
|
|
|
|
|
jobs:
|
2020-12-11 19:49:03 +06:00
|
|
|
format:
|
2020-12-10 23:01:51 +06: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-15 01:51:07 +06:00
|
|
|
- uses: rlespinasse/github-slug-action@v3.x
|
|
|
|
|
2020-12-10 23:01:51 +06:00
|
|
|
- uses: actions/checkout@v2
|
2020-12-17 05:00:02 +06:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.API_TOKEN_GITHUB }}
|
2020-12-10 23:01:51 +06:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
apt-get update && apt-get install -y dos2unix
|
|
|
|
|
|
|
|
- name: Format files
|
|
|
|
run: |
|
2020-12-11 19:49:03 +06:00
|
|
|
bin/qmk cformat -a
|
2020-12-10 23:01:51 +06:00
|
|
|
bin/qmk pyformat
|
|
|
|
bin/qmk fileformat
|
|
|
|
|
2021-02-06 18:55:50 +06: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 23:01:51 +06:00
|
|
|
with:
|
2021-02-06 18:55:50 +06:00
|
|
|
delete-branch: true
|
2021-02-15 01:51:07 +06:00
|
|
|
branch: bugfix/format_${{ env.GITHUB_REF_SLUG }}
|
2021-02-06 18:55:50 +06: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'
|