Skip to content

Commit 261d920

Browse files
committed
Improve markdownlint ci and add docs on sparse checkout
1 parent a0ed671 commit 261d920

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/markdownlint.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
permissions:
1414
contents: read
1515

16+
# This will only allow a single markdownlint action to run per PR.
17+
# Any github action running on the older commits will be aborted.
1618
concurrency:
1719
group: markdownlint-${{ github.workflow }}-${{ github.event.pull_request.number }}
1820
cancel-in-progress: true
@@ -26,16 +28,22 @@ jobs:
2628
uses: actions/checkout@v7
2729
with:
2830
fetch-depth: 1
31+
# Sparse checkout will only pull the specified files instead of the entire repo
32+
# This saves around 4s per run.
33+
# Sparse checkout sometimes pulls all files
34+
# https://github.com/actions/checkout/issues/1550
35+
36+
# Add a new step to test sparse-checkout if it fails as mentioned in the above issue
37+
# - name: Temp
38+
# working-directory: .
39+
# run: ls -la .server
40+
# shell: bash
41+
2942
sparse-checkout: |
3043
**/*.md
3144
.markdownlint-cli2.yaml
3245
sparse-checkout-cone-mode: false
3346

34-
- name: Temp
35-
working-directory: .
36-
run: ls -alh .
37-
shell: bash
38-
3947
- name: Run markdownlint
4048
uses: docker://davidanson/markdownlint-cli2:v0.23.0@sha256:97996d59837fa7cc27fc5f0e16d72eae71d0cefee15c437ee1d7cdbccb5552be
4149
with:

0 commit comments

Comments
 (0)