-
Notifications
You must be signed in to change notification settings - Fork 35
63 lines (54 loc) · 1.84 KB
/
update-rust-deps.yml
File metadata and controls
63 lines (54 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Update Rust Dependencies
on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 5 * * 1' # Every Monday at 05:00 UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update:
name: Upgrade Rust Crate Deps
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Rust
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
override: true
components: clippy, rustfmt
- name: Install cargo-edit
run: cargo install cargo-edit
- name: Upgrade all Cargo.toml dependencies
run: |
find . -name "Cargo.toml" -print0 | while IFS= read -r -d '' file; do
dir="$(dirname "$file")"
if cd "$dir"; then
cargo upgrade || true
fi
done
- name: Check if anything changed
id: git-check
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Create Pull Request
if: steps.git-check.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: rust-deps-upgrade
title: "chore: auto-update Rust dependencies"
commit-message: "chore: auto-update Rust dependencies via cargo upgrade"
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
sign-commits: true
body: |
This PR updates Rust dependencies using `cargo upgrade`.
labels: dependencies
draft: false