Merge pull request #172 from gwilymk/auto-update-lockfiles-for-renovate

Add github action for updating the lockfiles
This commit is contained in:
Gwilym Kuiper 2022-02-24 20:33:26 +00:00 committed by GitHub
commit 8c2da81e11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

22
.github/scripts/update-lockfiles.sh vendored Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
function update_lockfiles() {
for toml in **/Cargo.toml; do
(cd "$(dirname "$toml")" && cargo generate-lockfile)
done
}
update_lockfiles
update_lockfiles
update_lockfiles
update_lockfiles
git add -u
if [ "$(git diff --cached --name-only)" == '' ]; then
echo "No files updated"
exit 0
fi
git -c user.name="GBA bot" -c user.email="gw@ilym.me" commit -m 'Update lockfiles'
git push

21
.github/workflows/update-lockfiles.yml vendored Normal file
View file

@ -0,0 +1,21 @@
name: Update lockfiles
on:
push:
branches: [ 'renovate/*' ]
pull_request:
branches: [ 'renovate/*' ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Set CARGO_TARGET_DIR
run: echo "CARGO_TARGET_DIR=$HOME/target" >> $GITHUB_ENV
- name: Check out repository
uses: actions/checkout@v2
- name: Update lock files
run: bash .github/scripts/update-lockfiles.sh