Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Sep 23, 2023
1 parent f68b83d commit ad1a63c
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/superlinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:
type: string
required: false
default: '["ubuntu-latest"]'
reusable-linter-rules:
description: 'Whether to use LINTER_RULES_PATH in reusable workflow, defaults to `true`'
inject-rules-from-reusable:
description: 'Whether inject predefined rules from reusable workflow, defaults to `true`'
type: boolean
required: false
default: true
Expand All @@ -39,14 +39,12 @@ jobs:
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.reusable-linter-rules
name: Generate predefined rules files in reusable workflow
- if: inputs.inject-rules-from-reusable
name: Inject predefined rules from reusable workflow
env:
STEP_LINTER_RULES_PATH: ${{ github.workspace }}/reusable-linter-rules
STEP_REUSABLE_MARKDOWN_CONFIG_FILE_CONTENT: |
STEP_MARKDOWN_RULES: |
---
# https://github.com/super-linter/super-linter/blob/main/TEMPLATES/.markdown-lint.yml
# https://github.com/DavidAnson/markdownlint#optionsconfig
# https://github.com/DavidAnson/markdownlint#rules--aliases
MD004: false # Unordered list style
MD007:
Expand All @@ -62,11 +60,8 @@ jobs:
blank_lines: false # Error on blank lines
...
run: |
mkdir -p "$STEP_LINTER_RULES_PATH"
echo "LINTER_RULES_PATH=$STEP_LINTER_RULES_PATH" >> "$GITHUB_ENV"
rulepath="$STEP_LINTER_RULES_PATH/.markdown-lint.yml"
echo "Generated $rulepath:"
echo -n "$STEP_REUSABLE_MARKDOWN_CONFIG_FILE_CONTENT" | tee "$rulepath"
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
Expand Down

0 comments on commit ad1a63c

Please sign in to comment.