From 587e65fd4afe9b764aa8bd1369fadda8c98b2c37 Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Mon, 22 Jul 2024 14:38:24 +0100 Subject: [PATCH 1/2] Auto-merge bot PRs Closes #33. --- .github/workflows/auto-merge.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/auto-merge.yml diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml new file mode 100644 index 0000000..031c9a4 --- /dev/null +++ b/.github/workflows/auto-merge.yml @@ -0,0 +1,23 @@ +name: Dependabot and Pre-commit auto-merge + +on: + pull_request: + +permissions: + contents: write + pull-requests: write # Needed if in a private repository + +jobs: + auto-merge: + runs-on: ubuntu-latest + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }} + steps: + - name: Enable auto-merge for Dependabot PRs + run: | + gh pr review --approve "$PR_URL" + gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + # GitHub provides this variable in the CI env. You don't + # need to add anything to the secrets vault. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 17b0a7a14717e47a35aa4e098e55bec3a5092472 Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Mon, 22 Jul 2024 14:42:49 +0100 Subject: [PATCH 2/2] Don't tag code owners for simple package updates Fixes #36. --- .github/CODEOWNERS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a786403..cd0ceac 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,6 @@ -# Ensure that all PRs must be approved by at least one of the below +# Automatically tag the following users to review PRs * @alexdewar @dalonsoa @cc-a @AdrianDAlessandro + +# Exclude the following files as they are often updated by bots +.pre-commit-config.yaml +{{\ cookiecutter.project_slug\ }}/*requirements.txt