Skip to content

Commit 2225d16

Browse files
authored
ci: Skip build (and consecutive steps) when only changing .md files (#6523)
1 parent e04d2fc commit 2225d16

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ jobs:
108108
- *shared
109109
- 'packages/node/**'
110110
- 'packages/node-integration-tests/**'
111+
any_code:
112+
- '!**/*.md'
111113
112114
outputs:
113115
commit_label: '${{ env.COMMIT_SHA }}: ${{ env.COMMIT_MESSAGE }}'
@@ -117,12 +119,14 @@ jobs:
117119
changed_node: ${{ steps.changed.outputs.node }}
118120
changed_browser: ${{ steps.changed.outputs.browser }}
119121
changed_browser_integration: ${{ steps.changed.outputs.browser_integration }}
122+
changed_any_code: ${{ steps.changed.outputs.any_code }}
120123

121124
job_install_deps:
122125
name: Install Dependencies
123126
needs: job_get_metadata
124127
runs-on: ubuntu-20.04
125128
timeout-minutes: 15
129+
if: needs.job_get_metadata.outputs.changed_any_code == 'true' || github.event_name != 'pull_request'
126130
steps:
127131
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
128132
uses: actions/checkout@v3

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [master]
20+
paths:
21+
# When _only_ changing .md files, no need to run CodeQL analysis
22+
- '!**/*.md'
2023
schedule:
2124
- cron: '40 3 * * 0'
2225

0 commit comments

Comments
 (0)