Skip to content

Commit 7c90d29

Browse files
Merge pull request #20 from microsoft/ci/skip-tests-on-md-only
ci: skip unit tests on Markdown-only changes
2 parents e2f40dd + cb3acf8 commit 7c90d29

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,32 @@ on:
66
branches: [main]
77

88
jobs:
9+
changes:
10+
name: Detect changes
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
pull-requests: read
15+
outputs:
16+
non-md: ${{ steps.filter.outputs.non-md }}
17+
steps:
18+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Filter non-Markdown changes
23+
id: filter
24+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
25+
with:
26+
filters: |
27+
non-md:
28+
- '!(**/*.md)'
29+
- '!(**/*.md)/**'
30+
931
unit-tests:
1032
name: Unit Tests
33+
needs: changes
34+
if: needs.changes.outputs.non-md == 'true'
1135
runs-on: windows-latest
1236
steps:
1337
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

0 commit comments

Comments
 (0)