Skip to content

Commit 9fcd8bb

Browse files
committed
chore(ci): add auto-merge for dependabot PR
1 parent 71d304c commit 9fcd8bb

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
name: Cargo Build & Test
2-
32
on:
43
push:
54
pull_request:
65
workflow_dispatch:
7-
86
env:
97
CARGO_TERM_COLOR: always
10-
118
permissions:
129
contents: read
1310
pull-requests: read
14-
1511
jobs:
16-
build_and_test:
12+
build-and-test:
1713
name: Build & Test
1814
runs-on: ubuntu-latest
1915
strategy:
@@ -39,7 +35,6 @@ jobs:
3935
- run: cargo check-all-features -- --verbose
4036
- run: cargo build-all-features -- --verbose
4137
- run: cargo test-all-features -- --verbose
42-
4338
rustfmt:
4439
name: Check Format
4540
runs-on: ubuntu-latest
@@ -50,8 +45,7 @@ jobs:
5045
- run: rustup update stable && rustup default stable
5146
- run: rustup component add rustfmt
5247
- run: cargo fmt --all --check
53-
54-
build_docs:
48+
docs:
5549
name: Docs
5650
runs-on: ubuntu-latest
5751
steps:
@@ -60,3 +54,22 @@ jobs:
6054
fetch-depth: 0
6155
- run: rustup update nightly && rustup default nightly
6256
- run: RUSTDOCFLAGS="--cfg doc_cfg --html-in-header ./docs-header.html" cargo +nightly doc --all-features --no-deps
57+
dependabot:
58+
name: Dependabot Auto-merge
59+
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
60+
needs: [build-and-test, rustfmt, docs]
61+
runs-on: ubuntu-latest
62+
permissions:
63+
pull-requests: write
64+
contents: write
65+
steps:
66+
- id: metadata
67+
uses: dependabot/fetch-metadata@v2
68+
with:
69+
github-token: "${{ secrets.GITHUB_TOKEN }}"
70+
- run: |
71+
gh pr review --approve "$PR_URL"
72+
gh pr merge --squash --auto "$PR_URL"
73+
env:
74+
PR_URL: ${{github.event.pull_request.html_url}}
75+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)