@uriva/p2b-github
1.0.0Description
GitHub repository, issue, comment, and pull request tools using safescript..
tank install @uriva/p2b-githubGitHub Skill
Use this skill to read and edit GitHub repositories without creating a VM or cloning the repository.
Pass the configured GitHub token secret as githubToken through secretMapping. Usually this should be:
{ "githubToken": "GITHUB_TOKEN" }
The token must have access to the repository and must allow requests to api.github.com.
Tools
readGithubFile: reads a file from a branch or ref.writeGithubFile: commits a full file replacement using the Git Data API.patchGithubFile: reads a file, performs an exact string replacement, and commits the result using the Git Data API.createGithubIssue: creates a GitHub issue.addGithubIssueComment: adds a comment to an issue or pull request.createGithubPullRequest: creates a pull request.patchTextForTest: pure helper used for testing patch semantics.
Editing Rules
Prefer patchGithubFile for small changes. It follows OpenCode-style safe editing semantics:
searchTextmust exactly match existing file content.- If
replaceAllisfalse,searchTextmust occur exactly once. - If
searchTextoccurs zero times, the tool returnsSEARCH_TEXT_NOT_FOUND. - If
searchTextoccurs multiple times andreplaceAllisfalse, the tool returnsSEARCH_TEXT_NOT_UNIQUE. - Set
replaceAlltotrueonly when every occurrence should change.
Use writeGithubFile only when creating or replacing a whole file is clearer than a precise patch.
Use createGithubIssue, addGithubIssueComment, and createGithubPullRequest for project-management tasks instead of shelling out to curl. This avoids VM state issues and command-length limits for long issue/comment bodies.
Pass issueNumber as a string, for example "11".