Run link checks on modified files on push too (#152464)

https://github.com/pytorch/pytorch/issues/152439
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152464
Approved by: https://github.com/huydhn
This commit is contained in:
Anthony Shoumikhin 2025-04-29 22:08:40 +00:00 committed by PyTorch MergeBot
parent 89c0c3ca80
commit accffef504

View File

@ -25,7 +25,9 @@ jobs:
script: | script: |
./scripts/lint_urls.sh $( ./scripts/lint_urls.sh $(
[ "${{ github.event_name }}" = "pull_request" ] \ [ "${{ github.event_name }}" = "pull_request" ] \
&& git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} && git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \
|| [ "${{ github.event_name }}" = "push" ] \
&& git diff --name-only ${{ github.event.before }} ${{ github.sha }}
) || { ) || {
echo echo
echo "URL lint failed. If this is a transient outage, you can bypass it by adding the \`skip-url-lint\` label to your PR." echo "URL lint failed. If this is a transient outage, you can bypass it by adding the \`skip-url-lint\` label to your PR."
@ -46,5 +48,7 @@ jobs:
script: | script: |
./scripts/lint_xrefs.sh $( ./scripts/lint_xrefs.sh $(
[ "${{ github.event_name }}" = "pull_request" ] \ [ "${{ github.event_name }}" = "pull_request" ] \
&& git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} && git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \
|| [ "${{ github.event_name }}" = "push" ] \
&& git diff --name-only ${{ github.event.before }} ${{ github.sha }}
) )