name: github agent: CodeActAgent require_env_var:
SANDBOX_ENV_GITHUB_TOKEN: "Create a GitHub Personal Access Token (https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) and set it as SANDBOX_GITHUB_TOKEN in your environment variables."
GITHUB_TOKEN: A read-only token for Github.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.
GITHUB_TOKEN is read-only. Avoid operations that require write access.sed for file editing.