Skip to content

Commit 6c95a6d

Browse files
authored
Merge pull request #357 from commerce-docs/ds_add-suggested-changes
Enable suggested fixes for Markdown
2 parents b9c85da + 457b570 commit 6c95a6d

File tree

4 files changed

+49
-17
lines changed

4 files changed

+49
-17
lines changed

.github/super-linter.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
FIX_MARKDOWN=true
12
IGNORE_GITIGNORED_FILES=true
23
MARKDOWN_CONFIG_FILE=.markdownlint.yml
34
VALIDATE_ALL_CODEBASE=false
45
VALIDATE_GIT_MERGE_CONFLICT_MARKERS=true
56
VALIDATE_GITHUB_ACTIONS=true
6-
VALIDATE_JSON=true
77
VALIDATE_MARKDOWN=true
88
VALIDATE_YAML=true

.github/workflows/test-pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
permissions:
77
contents: read
88
statuses: write
9+
pull-requests: write
910

1011
jobs:
1112
testing:

.github/workflows/validate-pr_job.yml

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,50 @@ name: Reusable workflow to validate a pull request
33

44
on: workflow_call
55

6-
permissions:
7-
contents: read
8-
statuses: write
9-
106
jobs:
117
lint-test:
128
runs-on: ubuntu-latest
139

1410
steps:
15-
- name: Checkout Code
16-
uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
- name: Load super-linter configuration
20-
run: cat .github/super-linter.env >> "$GITHUB_ENV"
21-
22-
- name: Lint Code Base
23-
uses: super-linter/super-linter/[email protected]
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
- name: Checkout Code
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup reviewdog
17+
uses: reviewdog/[email protected]
18+
with:
19+
reviewdog_version: v0.20.3
20+
21+
- name: Load super-linter configuration
22+
shell: bash
23+
run: cat .github/super-linter.env >> "$GITHUB_ENV"
24+
25+
- name: Lint Code Base with super-linter and reviewdog
26+
uses: super-linter/super-linter/[email protected]
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Report linting results with reviewdog
31+
shell: bash
32+
run: |
33+
TMPFILE=$(mktemp)
34+
git diff > "${TMPFILE}"
35+
if [ ! -s "${TMPFILE}" ]; then
36+
echo "No changes detected, skipping reviewdog."
37+
exit 0
38+
fi
39+
git stash --include-untracked
40+
reviewdog \
41+
-f=diff \
42+
-f.diff.strip=1 \
43+
-name="markdownlint-fix" \
44+
-reporter="github-pr-review" \
45+
-filter-mode="diff_context" \
46+
-fail-level=error < "${TMPFILE}"
47+
git stash drop || true
48+
env:
49+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2650

2751
remark-test:
2852
runs-on: ubuntu-latest

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,11 @@ local-test.yml
4545
.yalc
4646
yalc.lock
4747

48-
tmp/
48+
tmp/
49+
50+
# Super-linter outputs
51+
super-linter-output
52+
super-linter.log
53+
54+
# GitHub Actions leftovers
55+
github_conf

0 commit comments

Comments
 (0)