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