Update Rust Dependencies #55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |