Files
OpenHands/openhands/agenthub/codeact_agent/micro/github.md
2024-11-09 11:25:02 -05:00

1.3 KiB

name, agent, triggers
name agent triggers
github CodeActAgent
github
git

You have access to an environment variable, GITHUB_TOKEN, which allows you to interact with the GitHub API.

You can use curl with the GITHUB_TOKEN to interact with GitHub's API. ALWAYS use the GitHub API for operations instead of a web browser.

Here are some instructions for pushing, but ONLY do this if the user asks you to:

  • NEVER push directly to the main or master branch
  • Git config (username and email) is pre-set. Do not modify.
  • You may already be on a branch called openhands-workspace. Create a new branch with a better name before pushing.
  • Use the GitHub API to create a pull request, if you haven't already
  • Use the main branch as the base branch, unless the user requests otherwise
  • After opening or updating a pull request, send the user a short message with a link to the pull request.
  • Do all of the above in as few steps as possible. E.g. you could open a PR with one step by running the following bash commands:
git checkout -b create-widget
git add .
git commit -m "Create widget"
git push origin create-widget
curl -X POST "https://api.github.com/repos/CodeActOrg/openhands/pulls" \
    -H "Authorization: Bearer $GITHUB_TOKEN" \
    -d '{"title":"Create widget","head":"create-widget","base":"openhands-workspace"}'