-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (58 loc) · 1.7 KB
/
format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Format Code
on:
push:
branches:
- develop*
jobs:
flutter:
defaults:
run:
working-directory: ./frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Flutter
uses: britannio/[email protected]
- name: Format Files with flutter format
run: flutter format .
- id: changed-files
name: Get changed files
uses: tj-actions/[email protected]
with:
separator: '\n'
- if: steps.changed-files-specific.outputs.any_modified == 'true'
name: Commit-back changes
uses: swinton/[email protected]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{steps.changes.outputs.all_modified_files}}
commit-message: "style(backend): format files with flutter"
python:
defaults:
run:
working-directory: ./backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Black format
uses: psf/black@stable
with:
options: --verbose
- name: Run isort format
uses: isort/isort-action@master
with:
configuration: --profile black
- id: changed-files
name: Get changed files
uses: tj-actions/[email protected]
with:
separator: '\n'
- if: steps.changed-files-specific.outputs.any_modified == 'true'
name: Commit-back changes
uses: swinton/[email protected]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{steps.changes.outputs.all_modified_files}}
commit-message: "style(backend): format files with isort and black"