Skip to content

Commit e9def1b

Browse files
authored
chore(ci): enable dependabot auto-merging (#110)
1 parent 69a3621 commit e9def1b

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

.github/workflows/CI.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,21 @@ jobs:
4848
msrv:
4949
runs-on: ubuntu-latest
5050
steps:
51-
- uses: actions/checkout@master
52-
- name: Get MSRV from Cargo.toml
53-
run: |
54-
MSRV=$(grep 'rust-version' Cargo.toml | sed 's/.*= *"\(.*\)".*/\1/')
55-
echo "MSRV=$MSRV" >> $GITHUB_ENV
56-
- uses: dtolnay/rust-toolchain@master
57-
with:
58-
toolchain: ${{ env.MSRV }}
59-
- uses: taiki-e/install-action@cargo-no-dev-deps
60-
- run: cargo no-dev-deps check --all
51+
- uses: actions/checkout@v6
52+
- uses: taiki-e/install-action@cargo-hack
53+
- run: cargo hack --no-dev-deps --rust-version check --all
54+
55+
# Automatically merge if it's a Dependabot PR that passes the build
56+
dependabot:
57+
needs: [test, fmt, clippy, cargo-deny, msrv]
58+
permissions:
59+
contents: write
60+
pull-requests: write
61+
runs-on: ubuntu-latest
62+
if: github.actor == 'dependabot[bot]'
63+
steps:
64+
- name: Enable auto-merge for Dependabot PRs
65+
run: gh pr merge --auto --squash "$PR_URL"
66+
env:
67+
PR_URL: ${{github.event.pull_request.html_url}}
68+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)