diff --git a/.github/workflows/repository_sanity.yaml b/.github/workflows/repository_sanity.yaml index 7387f1b3455a..869eef0069bf 100644 --- a/.github/workflows/repository_sanity.yaml +++ b/.github/workflows/repository_sanity.yaml @@ -25,8 +25,40 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: + filter: + runs-on: ubuntu-latest + timeout-minutes: 90 + permissions: + pull-requests: read + outputs: + gitignore: ${{ steps.filter.outputs.gitignore }} + readme: ${{ steps.filter.outputs.readme }} + package_name: ${{ steps.filter.outputs.package_name }} + steps: + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + id: filter + with: + filters: | + gitignore: + - '**/*.java' + - '.gitignore' + - '**/.gitignore' + - '.github/workflows/repository_sanity.yaml' + readme: + - 'generate-readme.py' + - '.github/requirements.txt' + - 'README.md' + - 'java-*/.repo-metadata.json' + - 'java-*/pom.xml' + - '.github/workflows/repository_sanity.yaml' + package_name: + - '**/*.java' + - '.github/workflows/repository_sanity.yaml' + gitignore_correctness: # Generated files should not match .gitignore + needs: filter + if: ${{ needs.filter.outputs.gitignore == 'true' }} runs-on: ubuntu-latest timeout-minutes: 90 steps: @@ -53,6 +85,8 @@ jobs: generate-readme: # Ensure generate-readme.py runs fine + needs: filter + if: ${{ needs.filter.outputs.readme == 'true' }} runs-on: ubuntu-latest timeout-minutes: 90 steps: @@ -68,6 +102,8 @@ jobs: - run: python3 generate-readme.py package_name_check: + needs: filter + if: ${{ needs.filter.outputs.package_name == 'true' }} runs-on: ubuntu-latest timeout-minutes: 90 steps: diff --git a/.github/workflows/versions.yaml b/.github/workflows/versions.yaml index 620691514609..67ac35533f5b 100644 --- a/.github/workflows/versions.yaml +++ b/.github/workflows/versions.yaml @@ -25,7 +25,26 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: + filter: + runs-on: ubuntu-latest + timeout-minutes: 90 + permissions: + pull-requests: read + outputs: + pom: ${{ steps.filter.outputs.pom }} + steps: + - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + id: filter + with: + filters: | + pom: + - '**/pom.xml' + - 'generation/check_non_release_please_versions.sh' + - '.github/workflows/versions.yaml' + unmanaged-versions-check: + needs: filter + if: ${{ needs.filter.outputs.pom == 'true' }} runs-on: ubuntu-latest timeout-minutes: 90 steps: