Skip to content

Bash and Python scripts to automate your Git & GitHub workflow. Made by using only standard python libraries.

License

Notifications You must be signed in to change notification settings

anupammaurya6767/GitHub-Automation-scripts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Automation Scripts 🤖

This repository hosts scripts written in bash script and python to automate common Git/GitHub workflows. Normally to connect a local repository to GitHub one has to go to the GitHub website, create a new respository and then add the new GitHub repo as a remote for your local repository. The create_repo script automates this process.

GitHub-Automation-scripts

Tech 🖥️

My Skills

Installation

Requirements:
  • Git Bash installed on your computer.
  • GitHub personal access token. (Go to your GitHub profile -> Settings -> Developer settings -> Personal Access Tokens -> Create new token with all the repository permissions)

Note!!! This script is written exclusively for Git Bash on Windows, you will have to modify it for other shells.

  • Step 1:

Fork and clone the repository locally.

  • Step 2:

Create a github_secrets.py file in the ./scripts folder and define the following variables inside it.

GITHUB_API_TOKEN = "Your GitHub personal access token"
USERNAME = "Your GitHub username"
  • Step 3:

Add the project path to the PATH variable (Recommended)

Run the following command in the project's base directory to add the scripts path to the PATH environment variable.

$ export PATH=$PATH":"$(pwd)"/scripts"

To permanently add the scripts path to the PATH variable, run the below command in the project's root directory. (This file is located in your home directory)

Make sure to backup the .bash_profile file elsewhere before making any changes to it.

$ echo 'export PATH=$PATH''":'"$(pwd)"'/scripts''"' >> ~/.bash_profile

OR

Run the following commands in the project folder to add the scripts to your bin directory

$ cp -r /scripts/* /usr/bin/

How to use

After the installation is complete then the 'create_repo' command should execute in any directory.

  • Run the command with a '-h' flag to see the help menu
create_repo -h
  • Sample usage
create_repo <PATH_NAME> <REPO_NAME>
  • <PATH_NAME> is the path where you want to create the local repository and <REPO_NAME> is the name for your repo
  • Example:
create_repo . test-repo

The result is a local respository is created with a connected remote repository automatically!

👨‍💻 Development

  • Join the project workspace on

  • Checkout the issues tab to find ideas!

  • Want to contribute? Great!
    Make sure to go through the Contributor's Guide. Trust me it wont take long ;)

  • Make sure to push your code to the contributing branch.

License

Licence

About

Bash and Python scripts to automate your Git & GitHub workflow. Made by using only standard python libraries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%