diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 80f78b01c980..d4c05a092c1d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,6 +12,7 @@ on: - landchecks/* tags: - ciflow/pull/* + - ciflow/trunk/* workflow_dispatch: permissions: read-all @@ -32,10 +33,12 @@ jobs: name: Get changed files uses: ./.github/workflows/_get-changed-files.yml with: - all_files: ${{ contains(github.event.pull_request.labels.*.name, 'lint-all-files') || contains(github.event.pull_request.labels.*.name, 'Reverted') }} + all_files: ${{ contains(github.event.pull_request.labels.*.name, 'lint-all-files') || contains(github.event.pull_request.labels.*.name, 'Reverted') || github.event_name == 'push' }} lintrunner-clang: uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + # Needed to prevent deduping on HUD + name: lintrunner-clang-${{ needs.get-changed-files.outputs.changed-files == '*' && 'all' || 'partial' }} needs: [get-label-type, get-changed-files] # Only run if there are changed files relevant to clangtidy / clangformat if: | @@ -75,6 +78,7 @@ jobs: # fails to find types when it should lintrunner-mypy: uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + name: lintrunner-mypy-${{ needs.get-changed-files.outputs.changed-files == '*' && 'all' || 'partial' }} needs: [get-label-type, get-changed-files] # Only run if there are changed files relevant to mypy if: | @@ -99,6 +103,7 @@ jobs: lintrunner-noclang: uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + name: lintrunner-noclang-${{ needs.get-changed-files.outputs.changed-files == '*' && 'all' || 'partial' }} needs: [get-label-type, get-changed-files] with: timeout: 120