-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (46 loc) · 1.35 KB
/
linter.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
name: Linter
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: TOC Generator
uses: technote-space/toc-generator@v4.0.0
with:
TOC_TITLE: ""
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies and run linters
run: |
git pull || true
python -m pip install --upgrade pip pre-commit
echo """
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
types_of: [markdown]
""" > .pre-commit-config.yaml
pre-commit install
pre-commit run --all-files || true
- name: Add and push files into github
run: |
echo """
[credential]
helper = store
[credential "https://github.com"]
username = phamquiluan
password = {{ secrets.TOKEN }}
""" > ~/.git-credentials
chmod 600 ~/.git-credentials
git config --global user.email "phamquiluan@gmail.com"
git config --global user.name "Luan Pham"
(git add README.md docs && git commit -m "chore(docs): fix styles" && git push) || true