Skip to content

add action to run cargo update #5

add action to run cargo update

add action to run cargo update #5

on: [pull_request]
name: "Update Cargo.lock"
# required for dependabot to be able to commit changes
permissions:
contents: write
jobs:
update-cargo-lock:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 2
- name: Check if Cargo.toml changed
id: changed-files-yaml
uses: tj-actions/changed-files@v45
with:
files_yaml: |
package:
Cargo.toml
- name: Rebuild
if: steps.changed-files-yaml.outputs.package_any_changed == 'true'
run: |
rm Cargo.lock
cargo build
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: "."
message: "update Cargo.lock"
push: true