Tool

Create or update file

The "Create or Update File" GitHub tool empowers developers to remotely manage files within their repositories with ease. It simplifies the process of creating new files or updating existing ones by handling all operations directly via GitHub API calls, eliminating the need for local file handling.

GitHub

Features

  • Seamlessly create new files or update existing files in any branch of a GitHub repository.
  • Supports updating files by requiring the SHA of the existing file to ensure safe overwrite operations.
  • Allows specifying commit messages to maintain clear version history and change tracking.
  • Works remotely via GitHub API, eliminating the need for local file system access or git commands.
  • Supports operations on repositories owned by individual users or organizations, providing flexible integration possibilities.

Benefits

  • Streamlines file management workflows by enabling remote operations directly from your tools or scripts.
  • Ensures safe updates by requiring SHA, preventing accidental overwrites and maintaining data integrity.
  • Enhances collaboration by integrating easily with CI/CD pipelines and automation tools.
  • Saves time and resources by eliminating manual git command usage and local cloning.
  • Improves project maintainability with clear and customizable commit messages for file changes.

Description

Create or update a single file in a GitHub repository. If updating, you must provide the SHA of the file you want to update. Use this tool to create or update a file in a GitHub repository remotely; do not use it for local file operations.

Parameters

7 parameters

NameTypeDescription
branchrequiredstring

Branch to create/update the file in

contentrequiredstring

Content of the file

messagerequiredstring

Commit message

ownerrequiredstring

Repository owner (username or organization)

pathrequiredstring

Path where to create/update the file

reporequiredstring

Repository name

shastring

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

Try Needle today

Streamline AI productivity at your company today

Join thousands of people who have transformed their workflows.

Agentic workflowsAutomations, meet AI agents
AI SearchAll your data, searchable
Chat widgetsDrop-in widget for your website
Developer APIMake your app talk to Needle
    Needle LogoNeedle
    Like many websites, we use cookies to enhance your experience, analyze site traffic and deliver personalized content while you are here. By clicking "Accept", you are giving us your consent to use cookies in this way. Read our more on our cookie policy .