workflow: post build result as comment
This commit is contained in:
@ -9,5 +9,8 @@ charset = utf-8
|
|||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.md]
|
[*.{markdown,md}]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.{yaml,yml}]
|
||||||
|
indent_size = 2
|
||||||
|
42
.github/workflows/fpb-lint.yml
vendored
42
.github/workflows/fpb-lint.yml
vendored
@ -1,20 +1,42 @@
|
|||||||
name: free-programming-books-lint
|
name: free-programming-books-lint
|
||||||
|
on:
|
||||||
on: [push, pull_request]
|
push:
|
||||||
|
pull_request:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '14.x'
|
||||||
- run: npm install -g free-programming-books-lint
|
- run: |
|
||||||
- run: fpb-lint ./books/
|
git clone https://github.com/SethFalco/free-programming-books-lint.git
|
||||||
- run: fpb-lint ./casts/
|
cd free-programming-books-lint
|
||||||
- run: fpb-lint ./courses/
|
git checkout origin/multiple-dirs
|
||||||
- run: fpb-lint ./more/
|
npm i
|
||||||
|
npm i -g .
|
||||||
|
- run: fpb-lint books casts courses more
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
- run: |
|
||||||
|
fpb-lint books casts courses more 2>&1 | tee output.log
|
||||||
|
result_code=${PIPESTATUS[0]}
|
||||||
|
|
||||||
|
if [ $result_code != 0 ]
|
||||||
|
then
|
||||||
|
gh pr review $PR --body "The build failed with the following output:
|
||||||
|
\`\`\`
|
||||||
|
$(cat output.log)
|
||||||
|
\`\`\`" --request-changes
|
||||||
|
else
|
||||||
|
gh pr review $PR --approve
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $result_code
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
PR: ${{ github.event.pull_request.html_url }}
|
||||||
|
17
.travis.yml
17
.travis.yml
@ -1,17 +0,0 @@
|
|||||||
language: shell
|
|
||||||
dist: xenial
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
-
|
|
||||||
language: node_js
|
|
||||||
node_js:
|
|
||||||
- 14
|
|
||||||
before_script:
|
|
||||||
- npm install -g free-programming-books-lint
|
|
||||||
script:
|
|
||||||
- fpb-lint ./books/
|
|
||||||
- fpb-lint ./casts/
|
|
||||||
- fpb-lint ./courses/
|
|
||||||
- fpb-lint ./more/
|
|
Reference in New Issue
Block a user