From 33caced556b1010b5b974966f6ac0f36c28a80f7 Mon Sep 17 00:00:00 2001 From: omkarkhatavkar Date: Mon, 22 Jan 2024 23:05:29 +0530 Subject: [PATCH] additional check before create issue for failed cherrypick --- .github/workflows/auto_cherry_pick.yml | 8 +++++++- .github/workflows/test.yml | 28 -------------------------- .github/workflows/test2.yml | 21 ------------------- 3 files changed, 7 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test2.yml diff --git a/.github/workflows/auto_cherry_pick.yml b/.github/workflows/auto_cherry_pick.yml index 324b0f1e861..d9602c74f57 100644 --- a/.github/workflows/auto_cherry_pick.yml +++ b/.github/workflows/auto_cherry_pick.yml @@ -97,10 +97,16 @@ jobs: labels: ["AutoMerge_Cherry_Picked"] }) + - name: Check if cherrypick pr is created + uses: juliangruber/find-pull-request-action@v1 + id: fpr + with: + branch: ${{ matrix.label }} + ## Failure Logging to issues and GChat Group - name: Create Github issue on cherrypick failure id: create-issue - if: ${{ always() && steps.cherrypick.outcome != 'success' && startsWith(matrix.label, '6.') && matrix.label != github.base_ref }} + if: ${{ always() && steps.fpr.outputs.number != '' && steps.cherrypick.outcome != 'success' && startsWith(matrix.label, '6.') && matrix.label != github.base_ref }} uses: dacbd/create-issue-action@main with: token: ${{ secrets.CHERRYPICK_PAT }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 078df81b564..00000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,28 +0,0 @@ - -# CI stages to execute against Pull Requests -name: Search GH PR's based on title - -on: - pull_request: - types: ["opened", "synchronize", "reopened"] - -jobs: - search_for_pr: - runs-on: ubuntu-latest - steps: - - name: Search for the pull request - id: search - uses: omkarkhatavkar/search-github-prs@main - with: - repo: 'satelliteqe/robottelo' - title: '[6.15.z] Sync project dependencies' - repo_token: '${{ secrets.CHERRYPICK_PAT }}' - - name: Check the result - run: | - echo "Result: ${{ steps.search.outputs.result }}" - if [ ${{ steps.search.outputs.result }} == 'success' ]; then - echo "The PR is found" - echo "${{ steps.search.outputs.details }}" - else - echo "Failed to find the PR" - fi diff --git a/.github/workflows/test2.yml b/.github/workflows/test2.yml deleted file mode 100644 index 1460f1bd7b2..00000000000 --- a/.github/workflows/test2.yml +++ /dev/null @@ -1,21 +0,0 @@ - -# CI stages to execute against Pull Requests -name: Search GH PR's based on title - -on: - pull_request: - types: ["opened", "synchronize", "reopened"] - -jobs: - search_for_pr: - runs-on: ubuntu-latest - steps: - - name: Find Pull Request - uses: juliangruber/find-pull-request-action@v1 - id: find-pull-request - with: - branch: omkarkhatavkar-patch-8 - - run: echo "Pull Request title ${number} ${title} (${sha})" - env: - number: ${{ steps.find-pull-request.outputs.number }} - sha: ${{ steps.find-pull-request.outputs.head-sha }}