Skip to content

Commit

Permalink
Update Dependabot automation (#18)
Browse files Browse the repository at this point in the history
* Update Dependabot automation

Signed-off-by: Andrej Orsula <[email protected]>

* Update Rust CI to maintain name for `cargo (MSRV)` job

Signed-off-by: Andrej Orsula <[email protected]>

---------

Signed-off-by: Andrej Orsula <[email protected]>
  • Loading branch information
AndrejOrsula authored Mar 9, 2024
1 parent 3817fc7 commit 32b4c67
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Dependabot automation
on:
pull_request:
check_run:
types: [completed]
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
approve:
dependabot_automation:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
steps:
Expand All @@ -18,23 +15,12 @@ jobs:
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve PR
- name: Approve the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: gh pr review --approve "$PR_URL"

auto_merge:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'check_run' }}
steps:
- name: Fetch metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable PR auto-merge
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
- name: Enable auto-merge for the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:
cancel-in-progress: true

env:
MSRV: "1.74"
PYTHON_VERSION: "3.10"
CARGO_TERM_COLOR: always
LIB_PACKAGE_NAME: pyo3_bindgen
Expand Down Expand Up @@ -41,7 +42,7 @@ jobs:
fail-fast: false
matrix:
toolchain:
- "1.74" # Minimal supported Rust version (MSRV)
- MSRV
- stable
- beta
steps:
Expand All @@ -50,9 +51,19 @@ jobs:
with:
save-if: ${{ github.event_name == 'push'}}
- uses: dtolnay/rust-toolchain@master
if: ${{ matrix.toolchain != 'MSRV' && matrix.toolchain != 'stable' }}
with:
toolchain: ${{ matrix.toolchain }}
- uses: dtolnay/rust-toolchain@master
if: ${{ matrix.toolchain == 'MSRV' }}
with:
toolchain: ${{ env.MSRV }}
- uses: dtolnay/rust-toolchain@master
if: ${{ matrix.toolchain == 'stable' }}
with:
toolchain: ${{ matrix.toolchain }}
components: clippy

- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
Expand Down

0 comments on commit 32b4c67

Please sign in to comment.