From 3ef5900ff719bcdc90c552f98c09578e98b7284b Mon Sep 17 00:00:00 2001 From: epolon Date: Mon, 1 Nov 2021 18:40:02 +0200 Subject: [PATCH 1/2] add auto approve label to dependabot prs --- .github/workflows/pr-labeler.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/pr-labeler.yml diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml new file mode 100644 index 0000000000000..b8a816623a9e0 --- /dev/null +++ b/.github/workflows/pr-labeler.yml @@ -0,0 +1,17 @@ +# Apply various labels on PRs + +name: pr-labeler +on: + pull_request: + types: [ opened ] + +jobs: + auto-approve: + if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]' + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - run: gh pr edit ${{ github.event.pull_request.number }} --add-label "pr/auto-approve" -R ${{ github.repository }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c5ecc0d55b79cd1d964a88d996224a63b42ce1a5 Mon Sep 17 00:00:00 2001 From: epolon Date: Mon, 1 Nov 2021 18:40:25 +0200 Subject: [PATCH 2/2] remove dependabot from rule and use standard auto approve label --- .github/workflows/auto-approve.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 6e186b15f078f..ed29d53382d1f 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -7,11 +7,7 @@ on: jobs: auto-approve: - if: > - github.event.pull_request.user.login == 'dependabot[bot]' - || github.event.pull_request.user.login == 'dependabot-preview[bot]' - || (contains(github.event.pull_request.labels.*.name, 'pr/auto-approve') - && github.event.pull_request.user.login == 'aws-cdk-automation') + if: contains(github.event.pull_request.labels.*.name, 'pr/auto-approve') runs-on: ubuntu-latest permissions: pull-requests: write