-
Notifications
You must be signed in to change notification settings - Fork 140
55 lines (51 loc) · 1.39 KB
/
lint_markdown.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
name: Markdown documents lint
defaults:
run:
shell: bash
on:
push:
branches:
- master
- develop
- release/*
paths:
- '**/*.md'
pull_request:
branches:
- master
- develop
- release/*
paths:
- '**/*.md'
jobs:
lint-markdown:
runs-on: ubuntu-20.04
name: Lint job
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Add scripts to the PATH
run: echo "${{ github.workspace }}/resources/ci_cd/" >> $GITHUB_PATH
- name: Set up Node
uses: actions/setup-node@v2-beta
with:
node-version: '14'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install necessary tools
run: |
npm install markdownlint-cli@0.23.1
- name: Perform format check in a pull request
if: github.event_name == 'pull_request'
working-directory: ${{ github.workspace }}
run: |
base_commit="${{ github.event.pull_request.base.sha }}"
head_commit="${{ github.event.pull_request.head.sha }}"
linux_format.py -py -clang -r "${base_commit}...${head_commit}"
- name: Perform format check in normal push
if: github.event_name == 'push'
working-directory: ${{ github.workspace }}
run: linux_format.py -py -clang -a