-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (76 loc) · 3.23 KB
/
superlinter.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
name: Reusable Workflow - superlinter
on:
workflow_call: # https://docs.github.com/en/actions/using-workflows/reusing-workflows
inputs:
timezone:
description: "The timezone, defaults to `Asia/Shanghai`"
type: string
required: false
default: "Asia/Shanghai"
runs-on:
description: 'The jobs.<job_id>.runs-on, defaults to `["ubuntu-latest"]`'
type: string
required: false
default: '["ubuntu-latest"]'
inject-rules-from-reusable:
description: "Whether inject predefined rules from reusable workflow, defaults to `true`"
type: boolean
required: false
default: true
filter-regex-exclude:
description: 'FILTER_REGEX_EXCLUDE for `super-linter`, defaults to `(\.vscode/)`'
type: string
required: false
default: '(\.vscode/)'
env:
TZ: ${{ inputs.timezone }}
jobs:
superlinter:
runs-on: ${{ fromJSON(inputs.runs-on) }}
permissions:
contents: read
packages: read
statuses: write
steps:
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full git history is needed to get a proper list of changed files within `super-linter`
# https://github.com/marketplace/actions/super-linter#template-rules-files
- if: inputs.inject-rules-from-reusable
name: Inject predefined rules from reusable workflow
env:
STEP_MARKDOWN_RULES: |
---
# https://github.com/super-linter/super-linter/blob/main/TEMPLATES/.markdown-lint.yml
# https://github.com/DavidAnson/markdownlint#rules--aliases
MD041: false # Badges on first line
MD004: false # Unordered list style
MD007:
indent: 2 # Unordered list indentation
MD013: # Line length 80 is far too short
line_length: 65535
MD026: # List of not allowed
punctuation: ".,;:!。,;:"
MD029: false # Ordered list item prefix
MD033: false # Allow inline HTML
MD036: false # Emphasis used instead of a heading
# https://github.com/DavidAnson/markdownlint#tags
blank_lines: false # Error on blank lines
...
run: |
mkdir -p '.github/linters'
echo -n "$STEP_MARKDOWN_RULES" > '.github/linters/.markdown-lint.yml'
# https://github.com/marketplace/actions/super-linter
- uses: super-linter/super-linter/slim@v5
name: 🔎🔎🔎 Run Super-Linter action
env:
SUPPRESS_POSSUM: true
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
GITHUB_TOKEN: ${{ github.token }}
GITHUB_ACTIONS_COMMAND_ARGS: "-ignore label.+unknown" # https://github.com/rhysd/actionlint/blob/main/docs/usage.md#super-linter
HADOLINT_FAILURE_THRESHOLD: error # https://github.com/hadolint/hadolint#configure
SHELLCHECK_OPTS: "--severity=warning" # https://github.com/koalaman/shellcheck#pre-commit
VALIDATE_BASH_EXEC: false
FILTER_REGEX_EXCLUDE: ${{ inputs.filter-regex-exclude }}