Skip to content

Commit 270d700

Browse files
committed
feat: add force_fmt input to sync workflow for optional formatting
1 parent 5f80078 commit 270d700

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/sync-upstream.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ on:
1919
description: 'Specific PR number (only for specific_pr mode)'
2020
required: false
2121
type: string
22+
force_fmt:
23+
description: 'Force run formatter on all existing sync branches'
24+
required: false
25+
default: false
26+
type: boolean
2227

2328
env:
2429
UPSTREAM_REPO: ionic-team/capacitor
@@ -128,11 +133,18 @@ jobs:
128133
# We need to check if the upstream PR has new commits
129134
OUR_BRANCH_HEAD=$(git rev-parse "origin/$SYNC_BRANCH")
130135
136+
# Check if force_fmt is enabled
137+
FORCE_FMT="${{ github.event.inputs.force_fmt }}"
138+
131139
# Check if upstream commit is already in our branch
132140
if git merge-base --is-ancestor "$UPSTREAM_HEAD" "origin/$SYNC_BRANCH" 2>/dev/null; then
133-
echo "Our sync branch is up to date with upstream PR, skipping..."
134-
git branch -D upstream-pr-$PR_NUMBER 2>/dev/null || true
135-
continue
141+
if [ "$FORCE_FMT" = "true" ]; then
142+
echo "Force fmt enabled - will re-format even though branch is up to date..."
143+
else
144+
echo "Our sync branch is up to date with upstream PR, skipping..."
145+
git branch -D upstream-pr-$PR_NUMBER 2>/dev/null || true
146+
continue
147+
fi
136148
else
137149
echo "Upstream PR has new commits! Updating our sync branch..."
138150
# Continue to re-sync the branch

0 commit comments

Comments
 (0)