GitHub File Management and Git Workflow Automation
detail.loadingPreview
Automate reading, editing, and pushing files to a GitHub repository using both the GitHub node and Git commands.
About This Workflow
This workflow demonstrates two primary methods for interacting with GitHub repositories using n8n:
- Direct GitHub Node Operations: This approach uses the n8n GitHub node to directly get, edit, and push files. It's simpler for single-file operations.
- Local Git Repository Operations: This approach involves cloning a repository locally, making changes using shell commands or other n8n nodes, and then using the n8n Git node to add, commit, and push those changes. This is more powerful for complex workflows involving multiple files or version control operations.
Key Features
- GitHub Node Integration: Read and edit files directly on GitHub.
- Git Node Integration: Perform
pull,add,commit, andpushoperations on a local Git repository. - Command Execution: Utilize
executeCommandfor file manipulation within a local repository. - Configuration Management: Store local repository paths and other configurations using the
Setnode. - Timestamping: Dynamically add current timestamps to file content and commit messages.
How To Use
- Manual Trigger: Start the workflow by clicking the 'Execute Workflow' button.
- Configuration (
confignode): Update thelocalrepoparameter to the correct path of your local Git repository. - Two Branches of Operation:
- GitHub Node Path (Top):
GitHub get fileretrievesREADME.mdfrom thegit_push_articlerepository.Decode fileconverts the base64 encoded content to plain text.GitHub push edited fileupdates theREADME.mdwith new content, including a timestamp, directly via the GitHub API.
- Git Node Path (Bottom):
Pullfetches the latest changes from the remote repository to the local one.Update README and add new fileusesexecuteCommandto append content toREADME.mdand create a new.mdfile.Add filesstages all changes in the local repository.Commitcreates a new commit with a specified message.Pushsends the committed changes to the remote GitHub repository.
- GitHub Node Path (Top):
- Credentials: Ensure you have configured the
TTT GitHub account(OAuth2) for GitHub node operations andTTT Git account(Git Password) for Git node operations. - Important Note: The
confignode'slocalrepopath needs to be accurately set for the Git node operations to function correctly.
Apps Used
Workflow JSON
{
"id": "cb9e5a00-f11a-4246-a0ce-4e07e3ababa1",
"name": "GitHub File Management and Git Workflow Automation",
"nodes": 5,
"category": "GitHub",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: cb9e5a00-f11a...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Automate Local Business Outreach with AI-Powered Yelp Scraper
This workflow automates the process of scraping local business details from Yelp using AI, then leverages that data to send personalized partnership proposals via Gmail. It's perfect for sales and marketing teams looking to streamline lead generation and outreach campaigns.
Automate Getty Images Editorial Search & CMS Integration
This n8n workflow automates searching for editorial images on Getty Images, extracts key details and embed codes, and prepares them for seamless integration into your Content Management System (CMS), streamlining your content creation process.