From cc2c43376e5f8b515562aa717bf4ff317846724d Mon Sep 17 00:00:00 2001 From: fOuttaMyPaint <154358121+TMHSDigital@users.noreply.github.com> Date: Sat, 25 Apr 2026 13:25:29 -0400 Subject: [PATCH] fix: port Unity's self-healing pattern to label-sync workflow Same fix as the tool-repo rollout in TMHSDigital/Developer-Tools-Directory#4. The meta-repo's label-sync.yml had the same fail-on-missing apply step, with `registry` as the latent missing label that would surface on PRs touching the registry/ path. Replaces the apply step with the per-label loop using `gh label create --force` before `gh pr edit --add-label`. Makes label creation idempotent. Closes #4. Signed-off-by: 154358121+TMHSDigital@users.noreply.github.com Made-with: Cursor --- .github/workflows/label-sync.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/label-sync.yml b/.github/workflows/label-sync.yml index 926ee30..466be2d 100644 --- a/.github/workflows/label-sync.yml +++ b/.github/workflows/label-sync.yml @@ -30,29 +30,33 @@ jobs: LABELS="" if echo "$FILES" | grep -q "^standards/"; then - LABELS="$LABELS,standards" + LABELS="$LABELS standards" fi if echo "$FILES" | grep -q "^scaffold/"; then - LABELS="$LABELS,scaffold" + LABELS="$LABELS scaffold" fi if echo "$FILES" | grep -q "^docs/"; then - LABELS="$LABELS,documentation" + LABELS="$LABELS documentation" fi if echo "$FILES" | grep -q "^registry.json"; then - LABELS="$LABELS,registry" + LABELS="$LABELS registry" fi if echo "$FILES" | grep -q "^\.github/"; then - LABELS="$LABELS,ci" + LABELS="$LABELS ci" fi - LABELS="${LABELS#,}" - if [ -n "$LABELS" ]; then - gh pr edit ${{ github.event.pull_request.number }} --add-label "$LABELS" + for label in $LABELS; do + gh label create "$label" --force --color "ededed" 2>/dev/null || true + gh pr edit ${{ github.event.pull_request.number }} --add-label "$label" + done + echo "Applied labels:$LABELS" + else + echo "No labels to apply" fi env: FILES: ${{ steps.changed.outputs.files }}