Skip to content

Update create_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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2025
Merged

Conversation

LuluBeatson
Copy link
Contributor

@LuluBeatson LuluBeatson commented Jul 8, 2025

Clarifies that sha is required if updating an existing file.

Required if updating an existing file. The blob SHA of the file being replaced.

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 tool

cc @audreee

@LuluBeatson LuluBeatson marked this pull request as ready for review July 8, 2025 11:35
@Copilot Copilot AI review requested due to automatic review settings July 8, 2025 11:35
@LuluBeatson LuluBeatson requested a review from a team as a code owner July 8, 2025 11:35
Copy link
Contributor

@Copilot Copilot AI left a 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 the sha parameter in the create_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

@LuluBeatson LuluBeatson merged commit 3341e6b into main Jul 8, 2025
16 checks passed
@LuluBeatson LuluBeatson deleted the lulu/file-sha branch July 8, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants