|
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 |
13 | 14 | docker-image: executorch-ubuntu-22.04-linter |
14 | | - submodules: 'none' |
| 15 | + submodules: false |
15 | 16 | fetch-depth: 0 |
16 | 17 | ref: ${{ inputs.ref }} |
17 | | - timeout: 90 |
| 18 | + timeout: 120 |
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 }} |
24 | | - ) |
| 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 }}"; } |
| 26 | + ) || { |
| 27 | + echo |
| 28 | + echo "URL lint failed." |
| 29 | + echo "If this is a transient outage, you can bypass it by adding the \`skip-url-lint\` label to your PR." |
| 30 | + echo "Or add \`@lint-ignore\` somewhere on the same line as the URL you want to skip checking." |
| 31 | + exit 1 |
| 32 | + } |
25 | 33 |
|
26 | 34 | lint-xrefs: |
| 35 | + if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'skip-xref-lint') }} |
27 | 36 | uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main |
28 | 37 | with: |
29 | 38 | runner: linux.2xlarge |
30 | 39 | docker-image: executorch-ubuntu-22.04-linter |
31 | | - submodules: 'none' |
| 40 | + submodules: false |
32 | 41 | fetch-depth: 0 |
33 | 42 | ref: ${{ inputs.ref }} |
34 | | - timeout: 90 |
| 43 | + timeout: 60 |
35 | 44 | script: | |
36 | 45 | ./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 }} |
41 | | - ) |
| 46 | + { [ "${{ github.event_name }}" = "pull_request" ] \ |
| 47 | + && git diff --name-only "${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}"; } \ |
| 48 | + || \ |
| 49 | + { [ "${{ github.event_name }}" = "push" ] \ |
| 50 | + && git diff --name-only "${{ github.event.before }}...${{ github.sha }}"; } |
| 51 | + ) || { |
| 52 | + echo |
| 53 | + echo "Xref lint failed." |
| 54 | + echo "If this is a transient outage, you can bypass it by adding the \`skip-xref-lint\` label to your PR." |
| 55 | + echo "Or add \`@lint-ignore\` somewhere on the same line as the reference you want to skip checking." |
| 56 | + exit 1 |
| 57 | + } |
0 commit comments