-
Notifications
You must be signed in to change notification settings - Fork 0
chore: ensure fleet repos with renovate.json are in Renovate App scope #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ANcpLua/github-settings-automation
Length of output: 282
🌐 Web query:
gh cligh api -iinclude response headers output format first line💡 Result:
When you run
gh api -i/--include, the first line of output is the HTTP status line in the formHTTP/<major>.<minor> <status-code> <reason-phrase>(the code printsresp.Protoandresp.Statusas the first line, followed by headers). [1] Example shape: - First line:HTTP/1.1 200 OK- Then response headers (and a blank line after headers before the body, if any). [1] Notes: --i/--includeis documented as “Include HTTP response status line and headers in the output.” [2]Citations:
🌐 Web query:
``gh api
exit code 404 nonzero behavior💡 Result:
When you run
gh apiand the GitHub API returns HTTP 404,ghtreats it as an error and exits with a non-zero status code (exit code 1 in the cited behavior). This means you should not expectgh apito “succeed” on not-found responses; you should handle 404 explicitly (e.g., by checking the exit status or by using flags/logic that tolerate errors). Evidence: - Theghissue discussion notes: “usinggh apito read non-existing resources will cause the command to exit with a status code of 1” and attributes this to the HTTP 404 response status returned by the API [1]. - Thegh apicommand is documented as making an authenticated HTTP request and printing the response; when the API responds with an error like 404, the command surfaces that as an error (“gh: Not Found (HTTP 404)”) in examples [2][3]. Related notes (why you might see 404s even when something “should” exist): - Missing OAuth token scopes can sometimes produce confusing 404s (e.g., missingworkflowscope when creating releases) [4]. If you tell me the exactgh apicommand you’re running (including flags like--silent,--method, and whether you’re using pipelines), I can suggest a reliable way to detect/ignore 404 in your script.Citations:
gh apireturn 404 Not Found when adding sub_issues cli/cli#12258gh release createworks for some commit hashes but gets weird 404 for others cli/cli#9773🏁 Script executed:
Repository: ANcpLua/github-settings-automation
Length of output: 282
🌐 Web query:
gh cligh api -iinclude response headers output format first line💡 Result:
When you run
gh api -i/gh api --include, the output starts with the HTTP status line (the “response status line”), i.e. the first line isHTTP/<version> <status code> <reason phrase>(e.g.,HTTP/2 200 OK). This happens because the--includeflag printsresp.Proto(protocol) andresp.Status(status line contents) as the first header line before printing the rest of the response headers. [1] After that first line,gh api -iprints the individual response headers, then a blank line (\r\n). [1]Citations:
🌐 Web query:
``gh api
exit code 404 nonzero behavior💡 Result:
When you run
gh apiand the GitHub REST API returns HTTP 404 (Not Found),gh apiexits non-zero (typically exit code 1). This matches GitHub’s expectation that 404 indicates an error condition for the requested resource/permission, and GitHub CLI treats non-2xx responses as failures. Evidence: - GitHub’s REST API troubleshooting doc notes that a 404 may be returned when a resource is private or authentication is missing/incorrect, and instructs you to check authentication/URL when you see 404. [1] -ghCLI issue reports showgh apisurfacing a 404 as an error (example:HTTP 404: Not Found ...). [2] - AghCLI issue clarifies that “usinggh apito read non-existing resources will cause the command to exit with a status code of 1” (even with-X HEAD). [3] Practical implications for scripting: - Don’t rely on output parsing from a 404; handle the exit code. - If you need different behavior on “not found,” capture the exit status and treat it as a special case. Example: -if ! gh api repos/OWNER/REPO/...; then ... # handle 404/not-found ... fiIf you want, paste the exactgh api ...command you’re running and how you’re checking the exit code/output, and I can suggest the cleanest conditional for your shell.Citations:
Differentiate 404 from other
gh apifailures in the Renovate config probe, and stop swallowing enrollment errorsThe config probe currently treats any non-zero
gh api repos/$repo/contents/$cfgresult as “no config” (stderr is suppressed), so 401/403/429/5xx can silently skip enrollment. Enrollment is also effectively unobservable: thePUT /user/installations/$RENOVATE_INSTALLATION_ID/repositories/$repo_idcall is fully swallowed (--silent ... >/dev/null 2>&1 || true), and the existing/repos/$repo/installationcall is ignored as well—so a stale/unauthorizedRENOVATE_INSTALLATION_IDcan result in zero enrollments with no signal. Handle only 404 as “absent”, warn/fail on other statuses, and log/report PUT failures.🤖 Prompt for AI Agents