Skip to content

Commit

Permalink
feat(CI): add the GitHub Super Linter
Browse files Browse the repository at this point in the history
Refactor old GitHub Actions
  • Loading branch information
jbampton committed Apr 11, 2021
1 parent e04a24f commit 7498173
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 48 deletions.
File renamed without changes.
File renamed without changes.
49 changes: 14 additions & 35 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,28 @@
name: ❄️ Lint
name: Lint

on: [pull_request]

jobs:
markdownlint:
name: 🍶 Markdown
merge-conflict:
name: Merge Conflict
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🚀 Use Node.js
uses: actions/[email protected]
with:
node-version: '12.x'
- run: npm install -g [email protected]
- run: markdownlint '**/*.md' --ignore node_modules
shellcheck:
name: 🥂 Shell
- name: Check merge conflict
run: grep "^<<<<<<< HEAD" $(git ls-files | xargs) && exit 1 || true
misspell:
name: Check Spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🧹 ShellCheck
uses: ludeeus/action-shellcheck@master
- name: Install
run: wget -O - -q https://git.io/misspell | sh -s -- -b .
- name: Misspell
run: git ls-files --empty-directory | xargs ./misspell -error
trailing-whitespace:
name: 🧋 Trailing whitespace
name: Trailing Whitespace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🧹 Check for trailing whitespace
run: |
cd utils || exit
sh ./check-for-trailing-whitespace.sh || exit 1
yamllint:
name: 🍺 YAML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install yamllint
- name: 🧹 YAML Lint
run: |
# return non-zero exit code on warnings
yamllint --strict .
- name: Check for trailing whitespace
run: "! git grep -EIn $'[ \t]+$'"
24 changes: 24 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint Code Base

on:
push:
branches-ignore: [master]
# Remove the line above to run when pushing to master
pull_request:
branches: [master]

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: github/super-linter@v3
env:
ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_MARKDOWN: true
VALIDATE_SHELL_SHFMT: true
VALIDATE_YAML: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Empty file added super-linter.report/.keep
Empty file.
13 changes: 0 additions & 13 deletions utils/check-for-trailing-whitespace.sh

This file was deleted.

0 comments on commit 7498173

Please sign in to comment.