diff options
author | Kirill Rysin <35688753+naspirato@users.noreply.github.com> | 2025-07-30 19:51:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-30 20:51:05 +0300 |
commit | 7f3853b276fa95fe959742c0af69f6c29e5cea88 (patch) | |
tree | aca3527141c63c70031ce282e277ea125f70de83 | |
parent | 8f303fb6d358395dda23dac9fb3d175c7341cecc (diff) | |
download | ydb-7f3853b276fa95fe959742c0af69f6c29e5cea88.tar.gz |
Update_automute_wf (#21878)
-rw-r--r-- | .github/workflows/update_muted_ya.yml | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/.github/workflows/update_muted_ya.yml b/.github/workflows/update_muted_ya.yml index e832b4fa44c..3d91d2f3f8b 100644 --- a/.github/workflows/update_muted_ya.yml +++ b/.github/workflows/update_muted_ya.yml @@ -8,7 +8,7 @@ on: branches: description: 'Comma-separated list of branches to process' required: false - default: 'main,stable-25-1,stable-25-1-analytics' + default: 'main,stable-25-1,stable-25-1-3' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -252,17 +252,37 @@ jobs: pull_number: ${{ steps.create_or_update_pr.outputs.pr_number }} team_reviewers: ${{ env.REVIEWERS }} token: ${{ secrets.YDBOT_TOKEN }} - - name: Enable auto-merge + + - name: Enable auto-merge (squash) if: env.changes == 'true' uses: actions/github-script@v7 with: github-token: ${{ secrets.YDBOT_TOKEN }} script: | const pr = ${{ steps.create_or_update_pr.outputs.pr_number }}; - await github.rest.pulls.update({ + + // Получаем ID PR для использования в GraphQL API + const { data: pullRequest } = await github.rest.pulls.get({ owner: context.repo.owner, repo: context.repo.repo, - pull_number: pr, - auto_merge: true + pull_number: pr }); - + + // Используем GraphQL API для включения auto-merge со squash + const mutation = ` + mutation EnableAutoMerge { + enablePullRequestAutoMerge(input: { + pullRequestId: "${pullRequest.node_id}", + mergeMethod: SQUASH + }) { + clientMutationId + } + } + `; + + try { + await github.graphql(mutation); + console.log("Auto-merge with squash successfully enabled"); + } catch (error) { + console.error("Failed to enable auto-merge with squash:", error); + } |