forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (60 loc) · 2.24 KB
/
_link_check.yml
File metadata and controls
62 lines (60 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
on:
workflow_call:
inputs:
runner:
type: string
required: true
ref:
type: string
required: true
jobs:
lint-urls:
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'skip-url-lint') }}
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
job-name: lint-urls
timeout: 120
runner: ${{ inputs.runner }}linux.2xlarge
docker-image: ci-image:pytorch-linux-jammy-linter
fetch-depth: 0
submodules: false
ref: ${{ inputs.ref }}
script: |
./scripts/lint_urls.sh $(
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
else
echo "${{ github.event.before }}" "${{ github.sha }}"
fi
) || {
echo
echo "URL lint failed."
echo "If this is a transient outage, you can bypass it by adding the \`skip-url-lint\` label to your PR."
echo "Or add \`@lint-ignore\` somewhere on the same line as the URL you want to skip checking."
exit 1
}
lint-xrefs:
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'skip-xref-lint') }}
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
job-name: lint-xrefs
timeout: 60
runner: ${{ inputs.runner }}linux.2xlarge
docker-image: ci-image:pytorch-linux-jammy-linter
fetch-depth: 0
submodules: false
ref: ${{ inputs.ref }}
script: |
./scripts/lint_xrefs.sh $(
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
else
echo "${{ github.event.before }}" "${{ github.sha }}"
fi
) || {
echo
echo "Xref lint failed."
echo "If this is a transient outage, you can bypass it by adding the \`skip-xref-lint\` label to your PR."
echo "Or add \`@lint-ignore\` somewhere on the same line as the reference you want to skip checking."
exit 1
}