Skip to content

Commit 994125d

Browse files
committed
ci: Run lint step for markdown-only PRs
1 parent 7ec21da commit 994125d

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ jobs:
165165
runs-on: ubuntu-20.04
166166
timeout-minutes: 15
167167
if: |
168-
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false') &&
169-
(needs.job_get_metadata.outputs.changed_any_code == 'true' || github.event_name != 'pull_request')
168+
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false')
170169
steps:
171170
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
172171
uses: actions/checkout@v4
@@ -215,6 +214,8 @@ jobs:
215214
needs: [job_get_metadata, job_install_deps]
216215
runs-on: ubuntu-20.04
217216
timeout-minutes: 30
217+
if: |
218+
(needs.job_get_metadata.outputs.changed_any_code == 'true' || github.event_name != 'pull_request')
218219
steps:
219220
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
220221
uses: actions/checkout@v4
@@ -323,6 +324,28 @@ jobs:
323324
- name: Validate ES5 builds
324325
run: yarn validate:es5
325326

327+
job_lint_md:
328+
name: Lint Markdown
329+
needs: [job_get_metadata, job_install_deps]
330+
timeout-minutes: 10
331+
runs-on: ubuntu-20.04
332+
if: needs.job_get_metadata.outputs.changed_any_code != 'true' && github.event_name == 'pull_request'
333+
steps:
334+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
335+
uses: actions/checkout@v4
336+
with:
337+
ref: ${{ env.HEAD_COMMIT }}
338+
- name: Set up Node
339+
uses: actions/setup-node@v4
340+
with:
341+
node-version-file: 'package.json'
342+
- name: Restore caches
343+
uses: ./.github/actions/restore-cache
344+
env:
345+
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
346+
- name: Lint .md files
347+
run: yarn lint:prettier
348+
326349
job_circular_dep_check:
327350
name: Circular Dependency Check
328351
needs: [job_get_metadata, job_build]
@@ -1015,6 +1038,7 @@ jobs:
10151038
job_e2e_tests,
10161039
job_artifacts,
10171040
job_lint,
1041+
job_lint_md,
10181042
job_circular_dep_check,
10191043
]
10201044
# Always run this, even if a dependent job failed

0 commit comments

Comments
 (0)