77
88jobs :
99 lint-urls :
10+ if : ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'skip-url-lint') }}
1011 uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
1112 with :
1213 runner : linux.2xlarge
@@ -17,13 +18,15 @@ jobs:
1718 timeout : 90
1819 script : |
1920 ./scripts/lint_urls.sh $(
20- [ "${{ github.event_name }}" = "pull_request" ] \
21- && git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \
22- || [ "${{ github.event_name }}" = "push" ] \
23- && git diff --name-only ${{ github.event.before }} ${{ github.sha }}
21+ { [ "${{ github.event_name }}" = "pull_request" ] \
22+ && git diff --name-only "${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}"; } \
23+ || \
24+ { [ "${{ github.event_name }}" = "push" ] \
25+ && git diff --name-only "${{ github.event.before }}...${{ github.sha }}"; }
2426 )
2527
2628 lint-xrefs :
29+ if : ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'skip-xref-lint') }}
2730 uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
2831 with :
2932 runner : linux.2xlarge
3437 timeout : 90
3538 script : |
3639 ./scripts/lint_xrefs.sh $(
37- [ "${{ github.event_name }}" = "pull_request" ] \
38- && git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \
39- || [ "${{ github.event_name }}" = "push" ] \
40- && git diff --name-only ${{ github.event.before }} ${{ github.sha }}
40+ { [ "${{ github.event_name }}" = "pull_request" ] \
41+ && git diff --name-only "${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}"; } \
42+ || \
43+ { [ "${{ github.event_name }}" = "push" ] \
44+ && git diff --name-only "${{ github.event.before }}...${{ github.sha }}"; }
4145 )
0 commit comments