@sigitcode-old / sigit / commits / 3189596
Fork 1

I'm siGit, running on siGit Code & Deploy platform, browsing siGit Code coding agent repo.

Reuse an open winget Package Request instead of filing another

Every run files a "[Package Request]: getSigit.siGitCode <version>" issue before opening the manifest PR, so each rerun after a failure added another one. 1.7.7 ended up with three. The step now looks for the issue account's open request with that exact title and reuses it. It only files a new one when there isn't one, and it skips the wait before the PR when the issue is reused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

foodandtravel committed Oct 29, 2026 at 23:04 UTC 3189596485ecd09327bea9d48c1c61108a019cac
1 file changed +25 -5
.github/workflows/release-winget.yml
+25 -5
@@ -196,17 +196,37 @@ jobs:
196 EOF
197 )
198
199 - ISSUE_URL=$(gh issue create \
199 + TITLE="[Package Request]: ${PACKAGE_IDENTIFIER} ${VERSION}"
200 +
201 + # A rerun after a later step failed would otherwise file a second
202 + # request for the same version (1.7.7 ended up with three). Reuse
203 + # this account's open one if there is one. The search only narrows
204 + # it down, the jq match on the exact title decides. If the lookup
205 + # itself fails, set -e stops here rather than filing a duplicate.
206 + ISSUE_URL=$(gh issue list \
207 --repo microsoft/winget-pkgs \
201 - --title "[Package Request]: ${PACKAGE_IDENTIFIER} ${VERSION}" \
202 - --body "$ISSUE_BODY")
208 + --author @me --state open \
209 + --search "\"${TITLE}\" in:title" \
210 + --json title,url \
211 + --jq "map(select(.title == \"${TITLE}\")) | first | .url // empty")
212 +
213 + if [ -n "$ISSUE_URL" ]; then
214 + echo "Reusing open issue ${ISSUE_URL}"
215 + echo "reused=true" >> "$GITHUB_OUTPUT"
216 + else
217 + ISSUE_URL=$(gh issue create \
218 + --repo microsoft/winget-pkgs \
219 + --title "$TITLE" \
220 + --body "$ISSUE_BODY")
221 + echo "Opened issue ${ISSUE_URL}"
222 + fi
223
204 - echo "Opened issue ${ISSUE_URL}"
224 echo "issue_url=${ISSUE_URL}" >> "$GITHUB_OUTPUT"
225 echo "issue_number=${ISSUE_URL##*/}" >> "$GITHUB_OUTPUT"
226
227 - name: Sebat dulu ...
209 - if: steps.issue.outputs.issue_number != ''
228 + # Only after a freshly filed issue. A reused one is already old.
229 + if: steps.issue.outputs.issue_number != '' && steps.issue.outputs.reused != 'true'
230 shell: bash
231 run: sleep $(( RANDOM % 61 + 150 ))
232