Skip to content

Commit 376c74b

Browse files
authored
Only check links in Markdown files, if Markdown files changed (#1866)
* Only check links in Markdown files, if Markdown files changed Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Applied review suggestions Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> --------- Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
1 parent f67550d commit 376c74b

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/md-link-check.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,30 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21+
22+
check-for-markdown-files:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
src: ${{ steps.filter.outputs.src }}
26+
steps:
27+
- name: Checkout source
28+
uses: actions/checkout@v7
29+
- uses: dorny/paths-filter@v4
30+
id: filter
31+
with:
32+
filters: |
33+
src:
34+
- '**/*.md'
35+
2136
lychee:
2237
name: Check Markdown Links
38+
needs: check-for-markdown-files
2339
# pull_request_target fires even when GITHUB_TOKEN creates the PR (e.g. the
2440
# release-notes bot). pull_request does not. We register pull_request_target
2541
# so bot-created PRs get a "skipped" conclusion that satisfies branch
2642
# protection, but we skip all real work: pull_request already covers human
2743
# PRs, and running twice would cause the concurrency group to cancel one run.
28-
if: github.event_name != 'pull_request_target'
44+
if: github.event_name != 'pull_request_target' && ${{ needs.check-changes.outputs.src == 'true' }}
2945
runs-on: ubuntu-latest
3046

3147
steps:

0 commit comments

Comments
 (0)