-
Notifications
You must be signed in to change notification settings - Fork 21
68 lines (60 loc) · 2.35 KB
/
formatter.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
59
60
61
62
63
64
65
66
67
68
name: Formatter handle web and lua files
on:
pull_request:
types: [ labeled ]
jobs:
get-changed-files:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Get changed files
id: changed-files-lua
uses: tj-actions/changed-files@v37
with:
files: |
**/*.lua
!**/*.yml
- name: List all changed files
run: |
for file in ${{ steps.changed-files-lua.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Get changed web files
id: changed-files-web
uses: tj-actions/changed-files@v37
with:
files: |
**/*.{js,html,css,jsx}
!**/*.yml
!**/*.min.js
- name: List all changed web files
run: |
for file in ${{ steps.changed-files-web.outputs.all_changed_files }}; do
echo "$file was changed"
done
outputs:
all-changed-files-lua-list: ${{ steps.changed-files-lua.outputs.all_changed_files }}
any-changed-files-lua-list: ${{ steps.changed-files-lua.outputs.any_changed }}
all-changed-files-web-list: ${{ steps.changed-files-web.outputs.all_changed_files }}
any-changed-files-web-list: ${{ steps.changed-files-web.outputs.any_changed }}
formatter-web:
needs: get-changed-files
uses: esx-framework/.github/.github/workflows/formatter-web.yml@main
if: ${{ github.event_name == 'pull_request' && github.event.label.name == 'run-format' }}
with:
all-changed-files-list: ${{ needs.get-changed-files.outputs.all-changed-files-web-list }}
any-changed-files-list: ${{ needs.get-changed-files.outputs.any-changed-files-web-list }}
formatter-lua:
needs: get-changed-files
uses: esx-framework/.github/.github/workflows/formatter-lua.yml@main
if: ${{ github.event_name == 'pull_request' && github.event.label.name == 'run-format' }}
with:
all-changed-files-list: ${{ needs.get-changed-files.outputs.all-changed-files-lua-list }}
any-changed-files-list: ${{ needs.get-changed-files.outputs.any-changed-files-lua-list }}