From 62820108ea4553dbde6246708f6f35f52131599c Mon Sep 17 00:00:00 2001 From: Antoni Ivanov Date: Wed, 8 Mar 2023 17:10:57 +0000 Subject: [PATCH 1/2] versatile-data-kit: automate merging of dependabot PRs Dependabot is creating PR. This is helping to automate them by 1. Automatically approving them 2. Automatically trying to merge them (only if all tests have passed) 3. Automatically updating them with latest changes Testing Done: created a fork and tested the flow there. using custom labels (as a proxy for dependabot) --- .github/workflows/dependabot.autoapprove.yml | 11 +++++++ .github/workflows/dependabot.automerge.yml | 32 ++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/dependabot.autoapprove.yml create mode 100644 .github/workflows/dependabot.automerge.yml diff --git a/.github/workflows/dependabot.autoapprove.yml b/.github/workflows/dependabot.autoapprove.yml new file mode 100644 index 0000000000..7ccd16b8a1 --- /dev/null +++ b/.github/workflows/dependabot.autoapprove.yml @@ -0,0 +1,11 @@ +name: Auto approve +on: pull_request_target + +jobs: + build: + runs-on: ubuntu-latest + permissions: + pull-requests: write + if: github.actor == 'dependabot[bot]' + steps: + - uses: hmarr/auto-approve-action@v3 \ No newline at end of file diff --git a/.github/workflows/dependabot.automerge.yml b/.github/workflows/dependabot.automerge.yml new file mode 100644 index 0000000000..30f15fccd5 --- /dev/null +++ b/.github/workflows/dependabot.automerge.yml @@ -0,0 +1,32 @@ +name: automerge +on: + pull_request: + types: + - labeled + - unlabeled + - synchronize + - opened + - edited + - ready_for_review + - reopened + - unlocked + pull_request_review: + types: + - submitted + check_suite: + types: + - completed + status: {} +jobs: + automerge: + runs-on: ubuntu-latest + steps: + - id: automerge + name: automerge + uses: "pascalgn/automerge-action@v0.15.6" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + MERGE_METHOD: "rebase" + MERGE_LABELS: "dependencies" + UPDATE_METHOD: "rebase" + UPDATE_LABELS: "dependencies" From 4eb3cc9ca3a086cfca3cc1fa4c6c205e15ee7867 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 17:22:39 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/dependabot.autoapprove.yml | 5 ++++- .github/workflows/dependabot.automerge.yml | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dependabot.autoapprove.yml b/.github/workflows/dependabot.autoapprove.yml index 7ccd16b8a1..bab1e76cd1 100644 --- a/.github/workflows/dependabot.autoapprove.yml +++ b/.github/workflows/dependabot.autoapprove.yml @@ -1,3 +1,6 @@ +# Copyright 2023-2023 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 + name: Auto approve on: pull_request_target @@ -8,4 +11,4 @@ jobs: pull-requests: write if: github.actor == 'dependabot[bot]' steps: - - uses: hmarr/auto-approve-action@v3 \ No newline at end of file + - uses: hmarr/auto-approve-action@v3 diff --git a/.github/workflows/dependabot.automerge.yml b/.github/workflows/dependabot.automerge.yml index 30f15fccd5..6e50af405a 100644 --- a/.github/workflows/dependabot.automerge.yml +++ b/.github/workflows/dependabot.automerge.yml @@ -1,3 +1,6 @@ +# Copyright 2023-2023 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 + name: automerge on: pull_request: