ci: enable dependabot auto-merge (#337)

This commit is contained in:
Stepan Kuzmin 2022-05-27 14:46:48 +03:00 committed by GitHub
parent 66876d5254
commit 9b4df609c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 3 deletions

View File

@ -266,7 +266,7 @@ jobs:
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 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: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
@ -274,7 +274,7 @@ jobs:
- name: Build and push the Docker image - name: Build and push the Docker image
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: 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 }} tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }} labels: ${{ steps.docker_meta.outputs.labels }}

22
.github/workflows/dependabot.yml vendored Normal file
View File

@ -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}}

View File

@ -53,8 +53,9 @@ jobs:
command: test command: test
args: --all args: --all
env: 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' 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 DATABASE_URL: postgres://postgres@localhost:${{ job.services.postgres.ports[5432] }}/test
- name: Gather coverage data - name: Gather coverage data