-
Notifications
You must be signed in to change notification settings - Fork 73
53 lines (50 loc) · 1.77 KB
/
linter.yaml
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
name: Run linter
on:
# Triggers the workflow on push or pull request events but only
# for the default branch
push:
branches:
- main
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Reformat Markdown files and commit changes
# Only run if the action is triggered by a pull request labeled as
# "smartling".
# This job needs to be able to continue if this step fails, e.g.
# in case there are no errors, hence no changes to commit.
if: github.event.pull_request.head.repo.full_name == github.repository && contains(github.event.pull_request.labels.*.name, 'smartling')
continue-on-error: true
run: |
bash .github/scripts/reformat_files_pr.sh ${{ github.repository }} ${{ github.event.pull_request.number }}
git config user.name 'flodolo'
git config user.email '[email protected]'
git add docs
git commit -m "Reformat Markdown files"
git push
- name: Run markdown linter
run: |
echo ${{github.event.pull_request.labels.*.name}}
npm install
npm test
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Check SUMMARY.md
run: |
python .github/scripts/check_summary.py docs