7
7
8
8
jobs :
9
9
lint-urls :
10
+ if : ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'skip-url-lint') }}
10
11
uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
11
12
with :
12
13
runner : linux.2xlarge
@@ -17,13 +18,15 @@ jobs:
17
18
timeout : 90
18
19
script : |
19
20
./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 }}"; }
24
26
)
25
27
26
28
lint-xrefs :
29
+ if : ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'skip-xref-lint') }}
27
30
uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
28
31
with :
29
32
runner : linux.2xlarge
34
37
timeout : 90
35
38
script : |
36
39
./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 }}"; }
41
45
)
0 commit comments