Skip to content

Commit

Permalink
workflow: post build result as comment
Browse files Browse the repository at this point in the history
  • Loading branch information
SethFalco committed Sep 28, 2021
1 parent 433bdd4 commit e9f7dff
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
[*.{markdown,md}]
trim_trailing_whitespace = false

[*.{yaml,yml}]
indent_size = 2
42 changes: 32 additions & 10 deletions .github/workflows/fpb-lint.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
name: free-programming-books-lint

on: [push, pull_request]

on:
push:
pull_request:
jobs:
build:

permissions:
pull-requests: write
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: npm install -g free-programming-books-lint
- run: fpb-lint ./books/
- run: fpb-lint ./casts/
- run: fpb-lint ./courses/
- run: fpb-lint ./more/
- run: |
git clone https://github.com/SethFalco/free-programming-books-lint.git
cd free-programming-books-lint
git checkout origin/multiple-dirs
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 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

0 comments on commit e9f7dff

Please sign in to comment.