From 7f84787a1a7c56ceda6a4469168120f925f28bf3 Mon Sep 17 00:00:00 2001 From: Victor Lin Date: Wed, 22 Jul 2026 16:24:16 -0700 Subject: [PATCH] Add option to use --force It's nice to have this option in case changes accidentally cause the .gitrepo file to fall out of sync (e.g. squash merges). Effectively reverts ".github/update-downstream-repos: Remove `--force` flag" (c732fc00). --- .github/workflows/update-downstream-repos.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-downstream-repos.yaml b/.github/workflows/update-downstream-repos.yaml index 76860d9..98a45c3 100644 --- a/.github/workflows/update-downstream-repos.yaml +++ b/.github/workflows/update-downstream-repos.yaml @@ -5,6 +5,12 @@ on: branches: - main workflow_dispatch: + inputs: + force: + description: 'Pass --force to git subrepo pull' + type: boolean + required: false + default: false concurrency: group: ${{ github.workflow }} @@ -106,7 +112,7 @@ jobs: git switch -c "$branch" fi - git subrepo pull "$VENDORED_PATH" + git subrepo pull "$VENDORED_PATH" ${{ inputs.force && '--force' || '' }} # Check for changes to determine if we need to create/update PRs changes=$(git rev-list --count "$parent".."$branch") @@ -124,6 +130,8 @@ jobs: Subrepo changes may break workflows and require manual updates to fix errors. It is safe to add manual updates directly to this PR since they will not be overwritten by future automatic updates. + + ${{ inputs.force && 'Subrepo updates were made with the `--force` flag so it overwrites any local changes in the subrepo.' || '' }} run: | if [[ "$changes" == "1" ]]; then git push origin HEAD