Skip to content

Commit a7ca311

Browse files
authored
Use three-dot diffs in URL and xref lint workflows
only run on the files actually modified in a PR, not every file touched on main since the branch point
1 parent 4dfddf5 commit a7ca311

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/_link_check.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
script: |
1919
./scripts/lint_urls.sh $(
2020
[ "${{ github.event_name }}" = "pull_request" ] \
21-
&& git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \
21+
&& git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} \
2222
|| [ "${{ github.event_name }}" = "push" ] \
23-
&& git diff --name-only ${{ github.event.before }} ${{ github.sha }}
23+
&& git diff --name-only ${{ github.event.before }}...${{ github.sha }}
2424
)
2525
2626
lint-xrefs:
@@ -35,7 +35,7 @@ jobs:
3535
script: |
3636
./scripts/lint_xrefs.sh $(
3737
[ "${{ github.event_name }}" = "pull_request" ] \
38-
&& git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \
38+
&& git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} \
3939
|| [ "${{ github.event_name }}" = "push" ] \
40-
&& git diff --name-only ${{ github.event.before }} ${{ github.sha }}
40+
&& git diff --name-only ${{ github.event.before }}...${{ github.sha }}
4141
)

0 commit comments

Comments
 (0)