This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
58 lines (49 loc) · 1.66 KB
/
lint-workflow.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Lint
on: pull_request
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install
run: npm ci
# Checks to see if any files in the PR match one of the listed file types.
# We can use this filter to decide whether or not to run linters or tests.
# You can check if a file with a listed file type is in the PR by doing:
# if: ${{ steps.filter.outputs.md == 'true' }}
# This will return true if there's a markdown file that was changed
# in the PR.
- uses: dorny/paths-filter@v2.2.1
id: filter
with:
filters: |
md:
- '**/*.md'
js:
- '**/*.js'
json:
- '**/*.json'
scss:
- '**/*.scss'
tags:
- 'src/site/_data/i18n/tags.yml'
# Use the filter to check if files with a specific file type were changed
# in the PR. If they were, run the relevant linters. Otherwise, skip.
- name: Lint Markdown
if: ${{ steps.filter.outputs.md == 'true' }}
run: npm run lint:md
- name: Lint Tags
if: ${{ steps.filter.outputs.tags == 'true' || steps.filter.outputs.md == 'true' }}
uses: ./.github/actions/lint-tags
- name: Lint JavaScript
if: ${{ steps.filter.outputs.js == 'true' || steps.filter.outputs.json == 'true' }}
run: npm run lint:js
- name: Lint SCSS
if: ${{ steps.filter.outputs.scss == 'true' }}
run: npm run lint:scss