From ecf7e8d48bd9b75c92f8509c1e4943441f4ecbba Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Thu, 29 Aug 2024 17:46:06 +0200 Subject: [PATCH 1/4] automatically approve PRs that were created by pulumi-bot pulumi-bot creates documentation update and version update PRs in this repo. These should be auto-merged, but that's broken because we've set up branch protections, and the action we're using to auto-merge PRs won't go ahead and try to merge PRs if they are not approved (even if there are exceptions set up in the branch protections to allow these PRs through). Auto-approve PRs that come from pulumi-bot. This should make the auto-merge automation work again. --- .github/workflows/auto-approve-for-auto-merge.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/auto-approve-for-auto-merge.yml diff --git a/.github/workflows/auto-approve-for-auto-merge.yml b/.github/workflows/auto-approve-for-auto-merge.yml new file mode 100644 index 000000000000..16100268051b --- /dev/null +++ b/.github/workflows/auto-approve-for-auto-merge.yml @@ -0,0 +1,12 @@ +name: Auto approve + +on: pull_request_target + +jobs: + auto-approve: + runs-on: ubuntu-latest + permissions: + pull-requests: write + if: (github.event.pull_request.user.login == 'pulumi-bot') && (github.event.pull_request.head.repo.full_name == github.repository) + steps: + - uses: hmarr/auto-approve-action@v4 From 74473066f4a330f76bd29cfbe5fcb13c8e591544 Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Thu, 29 Aug 2024 19:22:40 +0200 Subject: [PATCH 2/4] Update auto-approve-for-auto-merge.yml --- .github/workflows/auto-approve-for-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve-for-auto-merge.yml b/.github/workflows/auto-approve-for-auto-merge.yml index 16100268051b..93061759b2e7 100644 --- a/.github/workflows/auto-approve-for-auto-merge.yml +++ b/.github/workflows/auto-approve-for-auto-merge.yml @@ -1,6 +1,6 @@ name: Auto approve -on: pull_request_target +on: pull_request jobs: auto-approve: From 8a1c3c9d0c2cb47589b1b0498457ca7134eefc26 Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Thu, 29 Aug 2024 19:56:00 +0200 Subject: [PATCH 3/4] only run when we have the automation/merge label --- .github/workflows/auto-approve-for-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve-for-auto-merge.yml b/.github/workflows/auto-approve-for-auto-merge.yml index 93061759b2e7..921153bf9596 100644 --- a/.github/workflows/auto-approve-for-auto-merge.yml +++ b/.github/workflows/auto-approve-for-auto-merge.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write - if: (github.event.pull_request.user.login == 'pulumi-bot') && (github.event.pull_request.head.repo.full_name == github.repository) + if: (github.event.pull_request.user.login == 'pulumi-bot') && (github.event.pull_request.head.repo.full_name == github.repository) && (contains(github.event.pull_request.labels.*.name, 'automation/merge') steps: - uses: hmarr/auto-approve-action@v4 From 577baafb25420cf7c1a756eab6577636b55c7610 Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Thu, 29 Aug 2024 21:39:13 +0200 Subject: [PATCH 4/4] Update .github/workflows/auto-approve-for-auto-merge.yml Co-authored-by: Sean Holung --- .github/workflows/auto-approve-for-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve-for-auto-merge.yml b/.github/workflows/auto-approve-for-auto-merge.yml index 921153bf9596..dceb761134eb 100644 --- a/.github/workflows/auto-approve-for-auto-merge.yml +++ b/.github/workflows/auto-approve-for-auto-merge.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write - if: (github.event.pull_request.user.login == 'pulumi-bot') && (github.event.pull_request.head.repo.full_name == github.repository) && (contains(github.event.pull_request.labels.*.name, 'automation/merge') + if: (github.event.pull_request.user.login == 'pulumi-bot') && (github.event.pull_request.head.repo.full_name == github.repository) && (contains(github.event.pull_request.labels.*.name, 'automation/merge')) steps: - uses: hmarr/auto-approve-action@v4