- Notifications
You must be signed in to change notification settings - Fork1.4k
Updatecreate_or_update_file
SHA Arg Description#651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR clarifies the documentation for thesha
parameter in thecreate_or_update_file
function to make it explicit that the SHA is required when updating existing files. The updated description aligns with GitHub's REST API documentation and helps prevent errors where agents attempt to update files without providing the necessary blob SHA.
- Updates parameter description to explicitly state SHA requirement for file updates
- Aligns documentation with GitHub's official REST API specification
- Updates both code documentation and README to maintain consistency
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
pkg/github/repositories.go | Updates the SHA parameter description in the function definition |
pkg/github/toolsnaps/create_or_update_file.snap | Updates the corresponding test snapshot with new description |
README.md | Updates user-facing documentation to reflect the clarified parameter description |
3341e6b
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Clarifies that
sha
is required if updating an existing file.Fixes agent trying to update a file without providing the blob SHA.
New description is also more aligned to the API docs for this parameter
https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents
Relates to#605 because we would like to allow the agent get thee blob SHA using
get_file_contents
toolcc@audreee
ref:
https://github.com/github/copilot-productivity/issues/6450