diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1d5ffa5..1a36749 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -48,13 +48,21 @@ jobs: msrv: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Get MSRV from Cargo.toml - run: | - MSRV=$(grep 'rust-version' Cargo.toml | sed 's/.*= *"\(.*\)".*/\1/') - echo "MSRV=$MSRV" >> $GITHUB_ENV - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.MSRV }} - - uses: taiki-e/install-action@cargo-no-dev-deps - - run: cargo no-dev-deps check --all + - uses: actions/checkout@v6 + - uses: taiki-e/install-action@cargo-hack + - run: cargo hack --no-dev-deps --rust-version check --all + + # Automatically merge if it's a Dependabot PR that passes the build + dependabot: + needs: [test, fmt, clippy, cargo-deny, msrv] + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}}