fix(workflow): prevent PR branch bloat and respect wontfix label#935
Merged
Conversation
…x skip Agent-Logs-Url: https://github.com/Flobul/smartthings-capabilities/sessions/01b3d9c6-fbcb-43ee-84d7-6be80fe96966 Co-authored-by: Flobul <46993341+Flobul@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Flobul
May 21, 2026 11:24
View session
|
There was a problem hiding this comment.
Pull request overview
Updates the scheduled capability-generation workflow to avoid “branch pollution” by always creating clean, single-file PR branches from master, and to skip processing when an existing PR is labeled wontfix.
Changes:
- Pre-saves all modified API-downloaded files into
/tmpbefore any branch switching. - Switches to a “fresh branch from
master+ copy exactly the intended file” approach (force-push) to guarantee PRs don’t accumulate unrelated changes. - Adds a
wontfixlabel guard for existing open PRs on per-capability branches; removes the prior stash/merge-based workflow.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+143
to
+144
| # Query the GitHub API; tolerate "no PR" (empty list) without hiding auth/network failures | ||
| pr_info=$(gh pr list --state open --head "$branch_name" --json number,labels | jq -c '.[0] // empty' 2>/dev/null || true) |
| cp "/tmp/changed_trans/$(basename "$file")" "$file" | ||
| done | ||
|
|
||
| git add json/*.i18n.*.json json/*Presentation.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Each workflow run was merging all of master into existing PR branches (
git merge master --strategy-option=theirs), causing single-file capability PRs to balloon to hundreds of unrelated files over successive runs. Additionally, files with openwontfix-labelled PRs were continuously re-processed.Root causes
Changes
/tmpupfront — decouples file content from git branch state so subsequent checkouts cannot discard it.git checkout -B "$branch_name" masterfollowed by applying only that one file. Force-pushes override any bloated history. Guarantees exactly 1 file changed per PR regardless of prior runs.gh pr list --json labelsqueried before any git work; files whose open PR carrieswontfixare skipped entirely./tmp.--forcepush.