From b45668f5e96c23e0fce9090197a357f1750806b6 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Sun, 6 Aug 2023 21:04:58 +0100 Subject: [PATCH] Make it easier to run update-lockfiles locally --- .github/scripts/update-lockfiles.sh | 6 ++++-- .github/workflows/update-lockfiles.yml | 18 +++++++++--------- justfile | 4 ++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/scripts/update-lockfiles.sh b/.github/scripts/update-lockfiles.sh index e79e76a9..9d4f57b2 100755 --- a/.github/scripts/update-lockfiles.sh +++ b/.github/scripts/update-lockfiles.sh @@ -16,5 +16,7 @@ if [ "$(git diff --cached --name-only)" == '' ]; then exit 0 fi -git -c user.name="GBA bot" -c user.email="gw@ilym.me" commit -m 'Update lockfiles' -git push +if [ "$1" == '--commit' ]; then + git -c user.name="GBA bot" -c user.email="gw@ilym.me" commit -m 'Update lockfiles' + git push +fi \ No newline at end of file diff --git a/.github/workflows/update-lockfiles.yml b/.github/workflows/update-lockfiles.yml index b713c312..52ccaa3c 100644 --- a/.github/workflows/update-lockfiles.yml +++ b/.github/workflows/update-lockfiles.yml @@ -2,9 +2,9 @@ name: Update lockfiles on: push: - branches: [ 'renovate/*' ] + branches: ["renovate/*"] pull_request: - branches: [ 'renovate/*' ] + branches: ["renovate/*"] env: CARGO_TERM_COLOR: always @@ -13,10 +13,10 @@ 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@v3 - - uses: extractions/setup-just@v1 - - name: Update lock files - run: just update-lockfiles \ No newline at end of file + - name: Set CARGO_TARGET_DIR + run: echo "CARGO_TARGET_DIR=$HOME/target" >> $GITHUB_ENV + - name: Check out repository + uses: actions/checkout@v3 + - uses: extractions/setup-just@v1 + - name: Update lock files + run: just update-lockfiles --commit diff --git a/justfile b/justfile index 9f8117a8..1e3f339e 100644 --- a/justfile +++ b/justfile @@ -84,8 +84,8 @@ build-roms: build-book: (cd book && mdbook build) -update-lockfiles: - bash .github/scripts/update-lockfiles.sh +update-lockfiles *args: + bash .github/scripts/update-lockfiles.sh {{args}} update-linker-scripts: find -type f -name gba.ld | grep -v ./agb/gba.ld | xargs -n1 cp -v -- agb/gba.ld