on: workflow_call: inputs: 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: runner: linux.2xlarge docker-image: executorch-ubuntu-22.04-linter submodules: false fetch-depth: 0 ref: ${{ inputs.ref }} timeout: 120 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: runner: linux.2xlarge docker-image: executorch-ubuntu-22.04-linter submodules: false fetch-depth: 0 ref: ${{ inputs.ref }} timeout: 60 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 }