File tree 1 file changed +27
-4
lines changed
1 file changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ name: free-programming-books-lint
2
2
3
3
on : [push, pull_request]
4
4
5
+ env :
6
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7
+ GITHUB_RUN_ID : ${{ github.run_id }}
8
+ PR : ${{ github.event.pull_request.html_url }}
9
+
5
10
jobs :
6
11
build :
7
12
14
19
with :
15
20
node-version : ' 16.x'
16
21
- run : npm install -g free-programming-books-lint
17
- - run : fpb-lint ./books/
18
- - run : fpb-lint ./casts/
19
- - run : fpb-lint ./courses/
20
- - run : fpb-lint ./more/
22
+ - run : |
23
+ fpb-lint ./books/ &>> output.log || cat output.log
24
+ - run : |
25
+ fpb-lint ./casts/ &>> output.log || cat output.log
26
+ - run : |
27
+ fpb-lint ./courses/ &>> output.log || cat output.log
28
+ - run : |
29
+ fpb-lint ./more/ &>> output.log || cat output.log
30
+
31
+ - name : Output job
32
+ if : ${{ always() &&
33
+ github.event_name == 'pull_request' }}
34
+ run : |
35
+ if [ -s output.log ]
36
+ then
37
+ gh pr review $PR -r -b "Linter failed, fix the errors:
38
+ \`\`\`
39
+ $(cat output.log)
40
+ \`\`\`"
41
+ else
42
+ gh pr review $PR -a
43
+ fi
You can’t perform that action at this time.
0 commit comments