script: updated take commit message from user

This commit is contained in:
sankalp committed 2025-02-13 15:45:45 +05:45
1 parent b7915ec6f3
commit 4b510e4a75
1 file changed
+5 -3
+5 -3
View File
@@ -1,12 +1,14 @@
import os
import subprocess
def push_to_github(repo_path, commit_message):
def push_to_github(repo_path):
os.chdir(repo_path)
commit_message = input("Enter your commit message: ") # Take input from user
subprocess.run(["git", "add", "."])
subprocess.run(["git", "commit", "-m", commit_message])
subprocess.run(["git", "push"])
repo_path = r"C:\Users\nurpr\OneDrive\Desktop\Backend\news-portal"
commit_message = "Automated commit message"
push_to_github(repo_path, commit_message)
push_to_github(repo_path)