-
Notifications
You must be signed in to change notification settings - Fork 7
72 lines (62 loc) · 1.85 KB
/
Copy pathmarkdown_format.yml
File metadata and controls
72 lines (62 loc) · 1.85 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Lint and Format Markdown
on:
pull_request:
branches: [staging, production]
permissions:
contents: write
jobs:
lint-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tj-actions/changed-files@v46
id: changed-files
with:
files: |
**/*.md
!nexus-next/**/*.md
!nexus-sdk/**/*.md
- uses: DavidAnson/markdownlint-cli2-action@v20
if: steps.changed-files.outputs.any_changed == 'true'
with:
globs: ${{ steps.changed-files.outputs.all_changed_files }}
config: .markdownlint.json
fix: true
- name: "Import GPG key"
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
if: steps.changed-files.outputs.any_changed == 'true'
with:
gpg_private_key: ${{ secrets.DEVOPS_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.DEVOPS_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true
- name: "Commit and push changes"
uses: stefanzweifel/git-auto-commit-action@v5
if: steps.changed-files.outputs.any_changed == 'true'
with:
commit_user_name: "Talus DevOps"
commit_user_email: ${{ steps.import-gpg.outputs.email }}
commit_message: "style: format markdown files"
typos-check:
needs: lint-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tj-actions/changed-files@v46
id: changed-files
with:
files: |
**/*.md
!nexus-next/**/*.md
!nexus-sdk/**/*.md
- name: Check for typos
if: steps.changed-files.outputs.any_changed == 'true'
uses: crate-ci/typos@v1.32.0
with:
files: ${{ steps.changed-files.outputs.all_changed_files }}