From 3b16e8abc210af3c8a4744ea21f239ca87b6ace2 Mon Sep 17 00:00:00 2001 From: Xikaro Date: Fri, 25 Jul 2025 22:45:03 +0500 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b9ec6d2e..4e16276f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -219,19 +219,30 @@ jobs: - name: 🔍 Check existing PRs id: check_existing_pr uses: actions/github-script@v7.0.1 - with: - script: | - const { data: prs } = await github.rest.pulls.list({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open', - head: 'dev', - base: 'main' - }); - - return prs.length > 0; env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + script: | + try { + const { data: prs } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + head: `${context.repo.owner}:dev`, + base: 'main' + }); + + if (prs.length > 0) { + console.log(`â„šī¸ Found existing PR from dev to main: ${prs[0].html_url}`); + core.setOutput('exists', 'true'); + } else { + core.setOutput('exists', 'false'); + } + } catch (error) { + core.setFailed(`❌ Failed to check existing PRs: ${error}`); + core.setOutput('exists', 'error'); + } + - name: 📄 Create Pull Request if tag not found if: ${{ !steps.check_existing_pr.outputs.result }} @@ -240,6 +251,8 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} source_branch: dev target_branch: main + reviewer: Xikaro + ignore_users: "dependabot" title: 'Release: ${{ needs.info.outputs.project_version }}' body: | **This is an automated Pull Request from the dev branch.**