From 3389397b2f8aee92443a9f1b45f4a9a7dd49c0d7 Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Wed, 1 May 2024 15:37:44 -0700 Subject: [PATCH] Check changed files before running gradle check Signed-off-by: Sayali Gaikawad --- .github/workflows/gradle-check.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gradle-check.yml b/.github/workflows/gradle-check.yml index 0921aff721836..94e1a636557f3 100644 --- a/.github/workflows/gradle-check.yml +++ b/.github/workflows/gradle-check.yml @@ -7,17 +7,30 @@ 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)