From 18b266ab147f981a13399444cd910eba371037a3 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 24 Jul 2024 17:28:57 -0700 Subject: [PATCH] chore: Switch generator pull request management to auto-approve (#11451) --- .github/auto-approve.yml | 2 ++ .github/workflows/dailly-generate-updates.yml | 1 - .github/workflows/generate-updates.yml | 1 - .toys/generate-updates.rb | 5 +++-- 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 .github/auto-approve.yml diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 0000000000..e91850ef3c --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,2 @@ +processes: + - "RubyApiaryCodegen" diff --git a/.github/workflows/dailly-generate-updates.yml b/.github/workflows/dailly-generate-updates.yml index d52fbce857..0edb5e37b9 100644 --- a/.github/workflows/dailly-generate-updates.yml +++ b/.github/workflows/dailly-generate-updates.yml @@ -9,7 +9,6 @@ jobs: runs-on: ubuntu-20.04 env: GITHUB_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }} - APPROVAL_GITHUB_TOKEN: ${{secrets.YOSHI_APPROVER_TOKEN}} steps: - name: Checkout repo uses: actions/checkout@v4 diff --git a/.github/workflows/generate-updates.yml b/.github/workflows/generate-updates.yml index 5b00cbce37..e803da6138 100644 --- a/.github/workflows/generate-updates.yml +++ b/.github/workflows/generate-updates.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-20.04 env: GITHUB_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }} - APPROVAL_GITHUB_TOKEN: ${{secrets.YOSHI_APPROVER_TOKEN}} steps: - name: Checkout repo uses: actions/checkout@v4 diff --git a/.toys/generate-updates.rb b/.toys/generate-updates.rb index 5375c13fe2..7056efaa29 100644 --- a/.toys/generate-updates.rb +++ b/.toys/generate-updates.rb @@ -86,12 +86,13 @@ def handle_package api_name, index, total puts "(#{index}/#{total}) Pull request already exists for #{api_name}", :yellow return end - approval_message = "Rubber-stamped client auto-generation!" + approval_message = approval_token ? "Rubber-stamped client auto-generation!" : nil + labels = approval_token ? ["automerge: exact"] : nil result = yoshi_pr_generator.capture enabled: !git_remote.nil?, remote: git_remote, branch_name: branch_name, commit_message: commit_message, - labels: ["automerge"], + labels: labels, cooldown_wait: 15, auto_approve: approval_message, approval_token: approval_token do