@@ -2,11 +2,11 @@ name: Validate
22
33on :
44 # Run on all pushes and on all pull requests.
5- # Prevent the build from running when there are only irrelevant changes.
65 push :
7- paths-ignore :
8- - ' **.md'
96 pull_request :
7+ # Also run this workflow every Monday at 6:00 (to make sure the broken link check runs regularly).
8+ schedule :
9+ - cron : ' 0 6 * * 1'
1010 # Allow manually triggering the workflow.
1111 workflow_dispatch :
1212
7878 - name : Pipe Yamllint results on to GH for inline display
7979 if : ${{ failure() }}
8080 run : yamllint . --format github --strict
81+
82+ markdownlint :
83+ name : ' Lint Markdown'
84+ runs-on : ubuntu-latest
85+
86+ # Don't run the cronjob in this workflow on forks.
87+ if : github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
88+
89+ steps :
90+ - name : Checkout code
91+ uses : actions/checkout@v4
92+
93+ # @link https://github.com/marketplace/actions/problem-matcher-for-markdownlint-cli
94+ - name : Enable showing issue in PRs
95+ uses : xt0rted/markdownlint-problem-matcher@v3
96+
97+ # @link https://github.com/marketplace/actions/markdownlint-cli2-action
98+ - name : Check markdown with CLI2
99+ uses : DavidAnson/markdownlint-cli2-action@v16
100+
101+ remark :
102+ name : ' QA Markdown'
103+ runs-on : ubuntu-latest
104+
105+ # Don't run the cronjob in this workflow on forks.
106+ if : github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
107+
108+ steps :
109+ - name : Checkout code
110+ uses : actions/checkout@v4
111+
112+ - name : Set up node and enable caching of dependencies
113+ uses : actions/setup-node@v4
114+ with :
115+ node-version : " 20"
116+
117+ # To make the command available on CLI, it needs to be installed globally.
118+ - name : Install Remark CLI globally
119+ run : npm install --global remark-cli --foreground-scripts true --fund false
120+
121+ # To allow for creating a custom config which references rules which are included
122+ # in the presets, without having to install all rules individually, a local install
123+ # works best (and installing the presets in the first place, of course).
124+ #
125+ # Note: the first group of packages are all part of the mono "Remark lint" repo.
126+ # The second group of packages (heading-whitespace and down) are additional
127+ # "external" rules/plugins.
128+ - name : Install Remark rules locally
129+ run : >
130+ npm install --foreground-scripts true --fund false
131+ remark-lint
132+ remark-gfm
133+ remark-preset-lint-consistent
134+ remark-preset-lint-recommended
135+ remark-preset-lint-markdown-style-guide
136+ remark-lint-checkbox-content-indent
137+ remark-lint-linebreak-style
138+ remark-lint-no-dead-urls
139+ remark-lint-no-duplicate-defined-urls
140+ remark-lint-no-empty-url
141+ remark-lint-no-heading-like-paragraph
142+ remark-lint-no-reference-like-url
143+ remark-lint-no-unneeded-full-reference-image
144+ remark-lint-no-unneeded-full-reference-link
145+ remark-lint-strikethrough-marker
146+ remark-lint-heading-whitespace
147+ remark-lint-list-item-punctuation
148+ remark-lint-match-punctuation
149+ remark-lint-no-hr-after-heading
150+ remark-lint-are-links-valid-duplicate
151+ remark-validate-links
152+
153+ - name : Run Remark-lint
154+ run : remark . --frail
155+
156+ # @link https://github.com/reviewdog/action-remark-lint
157+ - name : Show Remark-lint annotations in PR
158+ if : ${{ failure() && github.event_name == 'pull_request' }}
159+ uses : reviewdog/action-remark-lint@v5
160+ with :
161+ fail_on_error : true
162+ install_deps : false
163+ level : info
164+ reporter : github-pr-check
0 commit comments