mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Merge pull request #172 from gwilymk/auto-update-lockfiles-for-renovate
Add github action for updating the lockfiles
This commit is contained in:
commit
8c2da81e11
22
.github/scripts/update-lockfiles.sh
vendored
Executable file
22
.github/scripts/update-lockfiles.sh
vendored
Executable 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
21
.github/workflows/update-lockfiles.yml
vendored
Normal 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
|
Loading…
Reference in a new issue