From 799a97b10a059498537351fdd55f7bba4dcd227a Mon Sep 17 00:00:00 2001 From: Mathieu Scheltienne Date: Tue, 10 Dec 2024 12:06:03 +0100 Subject: [PATCH] add automerge bot --- .github/workflows/bot.yaml | 21 +++++++++++++++++++++ .github/workflows/style.yaml | 9 ++------- 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/bot.yaml diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml new file mode 100644 index 0000000..ab02457 --- /dev/null +++ b/.github/workflows/bot.yaml @@ -0,0 +1,21 @@ +name: bot +concurrency: + group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} + cancel-in-progress: true +on: # yamllint disable-line rule:truthy + pull_request + +permissions: + contents: write + pull-requests: write + +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]') && github.repository == 'fcbg-platforms/python-tutorials' + steps: + - name: Enable auto-merge for bot PRs + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index e8551ad..fe86837 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -14,11 +14,6 @@ jobs: fail-fast: false name: pre-commit runs-on: ubuntu-latest - defaults: - run: - shell: bash steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Run pre-commit hooks - uses: pre-commit/action@v3.0.1 + - uses: actions/checkout@v4 + - uses: pre-commit/action@v3.0.1