Skip to content

Commit e9f7dff

Browse files
committed
workflow: post build result as comment
1 parent 433bdd4 commit e9f7dff

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

Diff for: .editorconfig

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ charset = utf-8
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
1111

12-
[*.md]
12+
[*.{markdown,md}]
1313
trim_trailing_whitespace = false
14+
15+
[*.{yaml,yml}]
16+
indent_size = 2

Diff for: .github/workflows/fpb-lint.yml

+32-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
11
name: free-programming-books-lint
2-
3-
on: [push, pull_request]
4-
2+
on:
3+
push:
4+
pull_request:
55
jobs:
66
build:
7-
7+
permissions:
8+
pull-requests: write
89
runs-on: ubuntu-latest
9-
1010
steps:
1111
- uses: actions/checkout@v2
1212
- name: Use Node.js
1313
uses: actions/setup-node@v1
1414
with:
1515
node-version: '14.x'
16-
- 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/
16+
- run: |
17+
git clone https://github.com/SethFalco/free-programming-books-lint.git
18+
cd free-programming-books-lint
19+
git checkout origin/multiple-dirs
20+
npm i
21+
npm i -g .
22+
- run: fpb-lint books casts courses more
23+
if: github.event_name == 'push'
24+
- run: |
25+
fpb-lint books casts courses more 2>&1 | tee output.log
26+
result_code=${PIPESTATUS[0]}
27+
28+
if [ $result_code != 0 ]
29+
then
30+
gh pr review $PR --body "The build failed with the following output:
31+
\`\`\`
32+
$(cat output.log)
33+
\`\`\`" --request-changes
34+
else
35+
gh pr review $PR --approve
36+
fi
37+
38+
exit $result_code
39+
if: github.event_name == 'pull_request'
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
PR: ${{ github.event.pull_request.html_url }}

Diff for: .travis.yml

-17
This file was deleted.

0 commit comments

Comments
 (0)