diff --git a/.github/workflows/set-default-pr-branch.yml b/.github/workflows/set-default-pr-branch.yml deleted file mode 100644 index 192417da55..0000000000 --- a/.github/workflows/set-default-pr-branch.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Check and Update PR Base Branch - -on: - pull_request: - branches: [main] - types: [opened, edited, reopened, synchronize] - -permissions: - pull-requests: write - -jobs: - check-and-update-base: - runs-on: ubuntu-latest - steps: - - name: Check and Update Base Branch - uses: actions/github-script@v7 - with: - github-token: ${{secrets.QA_DO_PAT}} - script: | - const prNumber = context.payload.pull_request.number; // Correct way to access PR number - const owner = context.repo.owner; - const repo = context.repo.repo; - const currentBase = context.payload.pull_request.base.ref; - const sourceBranch = context.payload.pull_request.head.ref; - const newBase = 'alpha'; - const allowedSources = ['alpha', 'beta']; - - if (currentBase === 'main' && !allowedSources.includes(sourceBranch)) { - console.log(`Updating the base of PR #${prNumber} from '${currentBase}' to '${newBase}' because the source branch is '${sourceBranch}'`); - await github.rest.pulls.update({ - owner, - repo, - pull_number: prNumber, - base: newBase, - }).then(response => { - console.log(`Base branch updated to '${newBase}': ${response.data.html_url}`); - }).catch(error => { - console.error(`Failed to update base branch: ${error}`); - }); - } else { - console.log(`No update needed for PR #${prNumber} (source: '${sourceBranch}', base: '${currentBase}')`); - }