diff --git a/.github/workflows/gradle-check.yml b/.github/workflows/gradle-check.yml index 0921aff721836..db1cc8be1389a 100644 --- a/.github/workflows/gradle-check.yml +++ b/.github/workflows/gradle-check.yml @@ -7,24 +7,35 @@ on: - 'dependabot/**' pull_request_target: types: [opened, synchronize, reopened] - paths-ignore: - - 'release-notes/**' - - '.github/**' - - '**.md' permissions: contents: read # to fetch code (actions/checkout) jobs: - gradle-check: + check-files: if: github.repository == 'opensearch-project/OpenSearch' + runs-on: ubuntu-latest + outputs: + RUN_GRADLE_CHECK: ${{steps.changed-files-specific.outputs.any_changed}} + steps: + - uses: actions/checkout@v3 + - name: Get changed files in the docs folder + id: changed-files-specific + uses: tj-actions/changed-files@v44 + with: + files_ignore: | + release-notes/** + .github/** + **.md + + gradle-check: + needs: check-files + if: github.repository == 'opensearch-project/OpenSearch' && needs.check-files.outputs.RUN_GRADLE_CHECK permissions: contents: read # to fetch code (actions/checkout) pull-requests: write # to create or update comment (peter-evans/create-or-update-comment) issues: write # To create an issue if check fails on push. - runs-on: ubuntu-latest - timeout-minutes: 130 steps: - name: Checkout OpenSearch repo uses: actions/checkout@v4