forked from EbookFoundation/free-programming-books
-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (37 loc) · 1.04 KB
/
fpb-lint.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
name: free-programming-books-lint
on: [push, pull_request]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_RUN_ID: ${{ github.run_id }}
PR: ${{ github.event.pull_request.html_url }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- run: npm install -g free-programming-books-lint
- run: |
fpb-lint ./books/ &>> output.log || cat output.log
- run: |
fpb-lint ./casts/ &>> output.log || cat output.log
- run: |
fpb-lint ./courses/ &>> output.log || cat output.log
- run: |
fpb-lint ./more/ &>> output.log || cat output.log
- name: Output job
if: ${{ always() &&
github.event_name == 'pull_request' }}
run: |
if [ -s output.log ]
then
gh pr review $PR -r -b "Linter failed, fix the errors:
\`\`\`
$(cat output.log)
\`\`\`"
else
gh pr review $PR -a
fi