Skip to content

Commit d32a44a

Browse files
committed
ci: only run sync idempotency when relevant paths change
1 parent ab02fff commit d32a44a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ jobs:
1515
- name: Checkout repository
1616
uses: actions/checkout@v6
1717

18+
- name: Detect changes
19+
id: changes
20+
uses: dorny/paths-filter@v3
21+
with:
22+
filters: |
23+
v1:
24+
- 'tools/v1_sync_pipeline/**'
25+
- 'docs/v1/**'
26+
v2:
27+
- 'tools/v2_sync_pipeline/**'
28+
- 'docs/v2/**'
29+
workflows:
30+
- '.github/workflows/**'
31+
1832
- name: Set up Python
1933
uses: actions/setup-python@v5
2034
with:
@@ -27,11 +41,13 @@ jobs:
2741
pip install -r requirements-ci.txt
2842
2943
- name: Ensure v1 sync script is idempotent
44+
if: steps.changes.outputs.v1 == 'true' || steps.changes.outputs.workflows == 'true'
3045
run: |
3146
python tools/v1_sync_pipeline/sync_v1_docs.py --fail-on-diff --summary-file "$GITHUB_STEP_SUMMARY"
3247
python tools/v1_sync_pipeline/qa/check_links.py docs/v1/affinity_api_docs.md
3348
3449
- name: Ensure v2 sync script is idempotent
50+
if: steps.changes.outputs.v2 == 'true' || steps.changes.outputs.workflows == 'true'
3551
run: |
3652
python tools/v2_sync_pipeline/sync_v2_docs.py --fail-on-diff --snapshot-dir tmp/v2
3753
python tools/v1_sync_pipeline/qa/check_links.py docs/v2/affinity_api_docs.md

0 commit comments

Comments
 (0)