Skip to content

Commit 77b5805

Browse files
Fix sync branch enumeration filter
Enumerate refs from refs/remotes/origin/* to avoid treating the parent remote ref as a branch named origin. Keep an explicit origin guard in both branch lists. Signed-off-by: Simon Beaudoin <sbeaudoi@qti.qualcomm.com>
1 parent a6f3084 commit 77b5805

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/workflows_sync.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,10 @@ jobs:
211211
212212
# Cleanup-only pass for non-packaging branches:
213213
# delete stale workflows that still contain pull_request_target.
214-
other_branches=$(git for-each-ref --format='%(refname:short)' refs/remotes/origin \
214+
other_branches=$(git for-each-ref --format='%(refname:short)' refs/remotes/origin/* \
215215
| sed 's|^origin/||' \
216216
| grep -Ev '^HEAD$' \
217+
| grep -Ev '^origin$' \
217218
| grep -Ev '(^|/)pr/' \
218219
| grep -Ev '^sync/' \
219220
| grep -v "^${default_branch}$" \
@@ -280,8 +281,9 @@ jobs:
280281
# - qcom/debian/*
281282
# - qcom/ubuntu/*
282283
# Exclude transient promotion branches (*/pr/*).
283-
packaging_branches=$(git for-each-ref --format='%(refname:short)' refs/remotes/origin \
284+
packaging_branches=$(git for-each-ref --format='%(refname:short)' refs/remotes/origin/* \
284285
| sed 's|^origin/||' \
286+
| grep -Ev '^origin$' \
285287
| grep -E '^(debian/|ubuntu/|qcom/debian/|qcom/ubuntu/)' \
286288
| grep -Ev '(^|/)pr/' \
287289
| sort -u)

0 commit comments

Comments
 (0)