From 9b4df609c6f71bef2f61c5cefa366e4a2ad6e02e Mon Sep 17 00:00:00 2001 From: Stepan Kuzmin Date: Fri, 27 May 2022 14:46:48 +0300 Subject: [PATCH] ci: enable dependabot auto-merge (#337) --- .github/workflows/ci.yml | 4 ++-- .github/workflows/dependabot.yml | 22 ++++++++++++++++++++++ .github/workflows/grcov.yml | 3 ++- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/dependabot.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 707f8e1c..6f5cb6a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -266,7 +266,7 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v2 - if: ${{ !github.event.pull_request.head.repo.fork }} + if: ${{ github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork }} with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} @@ -274,7 +274,7 @@ jobs: - name: Build and push the Docker image uses: docker/build-push-action@v3 with: - push: ${{ !github.event.pull_request.head.repo.fork }} + push: ${{ github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 00000000..4b365914 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,22 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1.1.1 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Enable auto-merge for Dependabot PRs + if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index 3e43eafd..71d8f85c 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -53,8 +53,9 @@ jobs: command: test args: --all env: - CARGO_INCREMENTAL: 0 + CARGO_INCREMENTAL: '0' RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' DATABASE_URL: postgres://postgres@localhost:${{ job.services.postgres.ports[5432] }}/test - name: Gather coverage data