AutomationMart
Home/Browse/Push multiple files to GitHub repository via Github REST API
n8n

Push multiple files to GitHub repository via Github REST API

n8nn8n9 modulesv1.0
GitHub

Introduction This workflow offers a streamlined solution for uploading multiple files to a GitHub repository simultaneously using GitHub's REST API. It addresses a significant limitation of n8n's native GitHub node, which only supports single-file uploads at a time. By leveraging GitHub's Git Data API, this workflow creates a new Git tree containing multiple files, commits this tree, and updates the target branch—all in a single automated process. The workflow is particularly valuable for automa

At a glance

Push multiple files to GitHub repository via Github REST API is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects GitHub. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
GitHub
Modules
9
Price
Free
Version
v1.0
Push multiple files to GitHub repository via Github REST API workflow diagram

About this workflow

Introduction This workflow offers a streamlined solution for uploading multiple files to a GitHub repository simultaneously using GitHub's REST API. It addresses a significant limitation of n8n's native GitHub node, which only supports single-file uploads at a time. By leveraging GitHub's Git Data API, this workflow creates a new Git tree containing multiple files, commits this tree, and updates the target branch—all in a single automated process. The workflow is particularly valuable for automation scenarios that require batch file operations, such as deploying website updates, publishing documentation, or maintaining configuration files across repositories. It eliminates the need for multiple separate API calls when working with multiple files, making your automation more efficient and less prone to partial update issues. By abstracting the complexities of GitHub's Git Data API into a reusable workflow, it provides a practical solution for developers, content managers, and DevOps professionals who need to programmatically manage repository content at scale. Who is this for? This workflow is designed for: - Developers and DevOps engineers who need to automate file updates in GitHub repositories - Content managers who regularly publish multiple files to GitHub-hosted websites or documentation - Automation specialists looking to integrate GitHub operations into larger workflows - Teams using n8n for CI/CD processes who need to push code or configuration changes Users should have basic familiarity with GitHub concepts (repositories, branches, commits) and should be comfortable obtaining and using GitHub Personal Access Tokens. While the workflow handles the API complexity, users should understand the fundamentals of version control to effectively utilize and customize it. What problem is this workflow solving? This workflow addresses several key challenges: 1. Limited batch operations: n8n's native GitHub node only supports uploading one file at a time, making multi-file operations cumbersome and inefficient. 2. API complexity: GitHub's Git Data API requires multiple sequential calls with interdependent data to create commits with multiple files, which is complex to implement manually. 3. Automation bottlenecks: Without this workflow, automating multi-file updates would require either multiple separate API calls (risking partial updates) or custom scripting outside of n8n. 4. Consistency issues: When files need to be updated together (e.g., code and corresponding documentation), this workflow ensures they're committed in a single atomic operation. By solving these issues, the workflow enables reliable, atomic updates of multiple files, maintaining repository consistency and simplifying automation processes. What this workflow does Overview This workflow uses GitHub's REST API to push multiple files to a repository in a single operation. It follows Git's internal model by: 1. Retrieving the current state of the repository 2. Creating a new tree with the files to be added or updated 3. Creating a new commit with this tree 4. Updating the branch reference to point to the new commit Process 1. Initialization: The workflow starts with a manual trigger and sets up GitHub credentials and repository information. 2. File Content Definition: Two "Set" nodes define the content for the files to be uploaded. 3. Repository State Retrieval: - The workflow fetches the latest commit SHA for the specified branch - It then retrieves the base tree SHA from this commit 4. Tree Creation: A new Git tree is created that includes both files (file1.txt and file2.txt), specifying their paths and content. 5. Commit Creation: A new commit is created with the specified commit message, referencing the new tree and the parent commit. 6. Branch Update: Finally, the branch reference is updated to point to the new commit, making the changes visible in the repository. Setup To use this workflow: 1. Import the workflow: Download the workflow JSON and import it into your n8n instance. 2. Create a GitHub Personal Access Token: - Go to GitHub Settings → Developer Settings → Personal Access Tokens → Fine-grained tokens - Create a new token with "Contents" permission (Read and write) for your target repository 3. Configure the workflow: - Update the "Set Github Info" node with: - Your GitHub Personal Access Token - Your GitHub username - Your repository name - The target branch (default is "main") - A commit message 4. Define file content: - Modify the "File 1" and "File 2" nodes with the content you want to upload 5. Adjust file paths if needed: - In the "Create new tree" node, update the file paths if you want to change where the files are stored in the repository 6. Save and run the workflow: Click "Test workflow" to execute the process. How to customize this workflow to your needs This workflow can be adapted in several ways: 1. Add more files: - Create additional "Set" nodes for more file content - In the "Create new tree" node, add more tree entries following the same pattern (path, mode, type, content) 2. Change file locations: - Modify the "path" parameters in the "Create new tree" node to place files in different directories 3. Dynamic file content: - Replace the static content in the "File" nodes with data from other sources - Use previous nodes or HTTP requests to generate file content dynamically 4. Conditional file updates: - Add IF nodes to determine which files should be updated based on certain conditions - Create separate branches in your workflow for different update scenarios 5. Scheduled updates: - Replace the manual trigger with a Schedule node to run the workflow at specific intervals - Combine with other triggers like Webhook or database events to push files when certain events occur 6. Error handling: - Add Error Trigger nodes to handle potential API failures - Implement notification nodes to alert you of successful pushes or failures

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Create GitHub issues from new Trello cards

Every time a new card is created in Trello, Make will automatically create a new issue in GitHub.

Free

Send push notifications via Google Chrome for new GitHub comments

Every time a new comment is added to GitHub, Make will automatically send a push notification via Google Chrome.

Free

Auto-categorize blog posts with OpenAI GPT-4, GitHub, and Google Sheets for Astro/Next.js

Automatically Assign Categories and Tags to Blog Posts with AI This workflow streamlines your content organization process by automatically analyzing new blog posts in your GitHub repository and assigning appropriate categories and tags using OpenAI. It compares new posts against existing entries in a Google Sheet, updates the metadata for each new article, and records the suggested tags and categories for review — all in one automated pipeline. --

Free

WordPress context backup to github

This template can backup WordPress context github。

Free

Create Bitbucket snippet comments from new GitHub comments

Every time a new comment is added in GitHub, Make will automatically create a new comment on a specified Bitbucket snippet.

Free

Manage construction projects with tasks, photo reports, Telegram & Google Sheets

How it works This template helps project managers collect task updates and photo reports from field workers via Telegram and stores everything in a Google Sheet. It enables daily project reporting without paper or back-office overhead. High-level flow: Workers receive daily tasks via Telegram They respond with photo reports Bot auto-saves replies (photos + status) to a Google Sheet The system tracks task completion, adds timestamps, and maintains report history Set up steps 🕒 Estimated setup tim

Free

Multi-user Telegram bot to summarize & repurpose YouTube videos with GPT-4o

Who’s it for This workflow is for content creators, marketers, educators, or anyone who wants to instantly summarize YouTube videos and repurpose them into different formats (LinkedIn post, tweet, etc.) via a simple Telegram chatbot. ⚙️ How it works This n8n automation listens for messages in Telegram. If the message contains a YouTube link, it: - Extracts the video ID - Fetches the video transcript using RapidAPI - Cleans the transcript of any special characters - Sends it to OpenAI to generate

Free

Automated book summarization with DeepSeek AI, Qdrant Vector DB & Google Drive

AI Book Summarizer with Vector Search – n8n Automation Overview This n8n workflow automates the process of summarizing uploaded books from Google Drive using vector databases and LLMs. It uses Cohere for embeddings, Qdrant for storage and retrieval, and DeepSeek or your preferred LLM for summarization and Q\&A. Designed for researchers, students, and productivity enthusiasts! Result Example --- Problem 🛠️ ⏳ Reading full books or papers to extract core ideas can take hours. 🧠 Manually summarizing

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free