mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
* update microagent name and update template.toml * substitute actual micro_agent_name for prompt manager * add python-frontmatter * support micro agent in codeact * add test cases * add instruction from require env var * add draft gh micro agent * update poetry lock * update poetry lock
1.9 KiB
1.9 KiB
name, agent, require_env_var
| name | agent | require_env_var | ||
|---|---|---|---|---|
| github | CodeActAgent |
|
How to Interact with Github
Environment Variable Available
GITHUB_TOKEN: A read-only token for Github.
Using GitHub's RESTful API
Use curl with the GITHUB_TOKEN to interact with GitHub's API. Here are some common operations:
-
View an issue:
curl -H "Authorization: token $GITHUB_TOKEN" \ https://api.github.com/repos/{owner}/{repo}/issues/{issue_number} -
List repository issues:
curl -H "Authorization: token $GITHUB_TOKEN" \ https://api.github.com/repos/{owner}/{repo}/issues -
Get repository details:
curl -H "Authorization: token $GITHUB_TOKEN" \ https://api.github.com/repos/{owner}/{repo} -
List pull requests:
curl -H "Authorization: token $GITHUB_TOKEN" \ https://api.github.com/repos/{owner}/{repo}/pulls -
Get user information:
curl -H "Authorization: token $GITHUB_TOKEN" \ https://api.github.com/user
Replace {owner}, {repo}, and {issue_number} with appropriate values.
Important Notes
- Always use the GitHub API for operations instead of a web browser.
- The
GITHUB_TOKENis read-only. Avoid operations that require write access. - Git config (username and email) is pre-set. Do not modify.
- Edit and test code locally. Never push directly to remote.
- Verify correct branch before committing.
- Commit changes frequently.
- If the issue or task is ambiguous or lacks sufficient detail, always request clarification from the user before proceeding.
- You should avoid using command line tools like
sedfor file editing.