forked from Lucaslhm/Flipper-IRDB
-
Notifications
You must be signed in to change notification settings - Fork 313
64 lines (53 loc) · 1.84 KB
/
pr-lint.yaml
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
name: "🧐 Checking IR Files"
on:
pull_request_target:
paths: '**.ir'
jobs:
lint:
name: "🐛 Looking for issues"
runs-on: ubuntu-latest
steps:
# checkout IRDB
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
# checkout Linter
- name: Clean Script Directory
run: rm -rf fff-ir-lint
- uses: actions/checkout@v3
with:
repository: 'darmiel/fff-ir-lint'
path: fff-ir-lint
# only check files changed in the PR
- name: Get Changed Files
id: changed-files
uses: tj-actions/[email protected]
with:
files: "**/*.ir"
separator: "\n"
sha: ${{ github.event.pull_request.head.sha }}
- name: Save changed file names to file
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' > changed_file_list.txt
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Run Linter if at least 1 IR File Changed
uses: mathiasvr/[email protected]
id: run
continue-on-error: true
with:
run: 'LINTER_CONFIG=.fff-ir-lint.json python fff-ir-lint/main.py github2 file:changed_file_list.txt'
- uses: ntsd/auto-request-changes-action@v2
name: "Request Changes"
if: ${{ steps.run.outputs.stderr }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
comment-body: |
<details>
<summary>🐛 Linter Result</summary>
${{ steps.run.outputs.stdout }}
</details>
- name: Fail Pipeline
if: ${{ steps.run.outputs.stderr }}
run: exit 1