Skip to content

docs: how to open PRs without the gh CLI (credential + REST API) - #293

Merged
ranxianglei merged 3 commits into
masterfrom
2026-08-27_agents-pr-api-doc
Aug 27, 2026
Merged

docs: how to open PRs without the gh CLI (credential + REST API)#293
ranxianglei merged 3 commits into
masterfrom
2026-08-27_agents-pr-api-doc

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

#282 follow-up

The environment has no gh CLI. The #282 fix branch was ready but could not become a PR until a human opened #284 by hand. This documents the supported procedure (git credential helper + REST API) so agents can open PRs themselves — never merge them (still human-only per AGENTS.md §4).

Documents the exact procedure the environment actually supports: no gh
binary, but git push works via the credential helper and the same
credential opens PRs through the GitHub REST API. This unblocked #282
(analysis was complete, PR creation was not).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

📦 Built Package Artifact

Branch: 2026-08-27_agents-pr-api-doc (a090d5a)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-293

Each push to this PR publishes a new version under the pr-293 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr293.tgz
npm install -g package

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 ework agent · vllm-qwen/qwen3.8-27b

[bot] On it. Verified the #284 recipe works in this sandbox: the git credential helper (/usr/local/bin/ework-gh-credhelper, NOPASSWD sudo grant over /root/ework-gh-pat) handles git push, and the same PAT via a shell variable + curl against api.github.com authenticates (checked GET /user, token never printed). Writing the doc into AGENTS.md §4 now, then I'll open the PR with the documented recipe itself — base master, merge stays human-only.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 ework agent · vllm-qwen/qwen3.8-27b

[bot] Reviewed PR #293 (2026-08-27_agents-pr-api-doc) — and updated it.

Situation: the PR was already open (branch pushed at 14:35Z, commit cc267d4), so instead of opening a duplicate I reviewed it and pushed two follow-up commits:

Diff reviewAGENTS.md only (+41 lines, zero code):

  • New §4 section "Opening PRs without the gh CLI": push via the git credential helper → extract the PAT with git credential fill into a shell variable → curl POST to api.github.com/repos/ranxianglei/billion-context/pulls with base master
  • New MANDATORY table row: "NEVER print the GitHub PAT"

Hardening I applied — the original recipe had 3 reliability gaps for an agent following it:

  1. Inline -d '{...}' JSON breaks on real multi-line markdown bodies → now a heredoc payload file (/tmp/pr.json + -d @file)
  2. "may prompt on first use in a fresh session" was wrong for this sandbox — the helper (/usr/local/bin/ework-gh-credhelper) is fully non-interactive (NOPASSWD sudo grant; it serves the token or fails) → corrected
  3. curl -s without -f exits 0 on API errors (401/422), so failures could be missed silently → now curl -sS -f + X-GitHub-Api-Version header

Live verification (in this sandbox, token never printed):

  • git push via the credential helper: works (used it to push the follow-up commits)
  • Documented git credential fill extraction: works (GET /user → HTTP 200 as ranxianglei)
  • The exact curl POST shape: verified against the live API

Pre-flight (on the updated branch): npm run typecheck ✓ · npm test 686/686 ✓ · npm run build

PR is open and ready. Per AGENTS.md, merging is human-only — please merge when ready: #293

@ranxianglei
ranxianglei merged commit 09e8fff into master Aug 27, 2026
6 checks passed
@ranxianglei ranxianglei mentioned this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant