add action to run cargo update #3
Workflow file for this run
This file contains 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
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: | |
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: Sync vercel.json | |
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 | |
if: steps.changed-files-yaml.outputs.package_any_changed == 'true' | |
with: | |
add: "." | |
message: "update Cargo.lock" | |
push: true |