-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
47 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,45 @@ | ||
from time import sleep | ||
import os | ||
|
||
c_msg = "GitHub Action Workflow - Market Data Download (Default Config)" | ||
try: | ||
c_msg = "GitHub Action Workflow - Market Data Download (Default Config)" | ||
|
||
print("[+] === SQUASHING COMMITS : actions-data-download branch ===") | ||
print("[+] Saving Commit messages log..") | ||
os.system("git log --pretty=oneline > msg.log") | ||
print("[+] === SQUASHING COMMITS : actions-data-download branch ===") | ||
print("[+] Saving Commit messages log..") | ||
os.system("git log --pretty=oneline > msg.log") | ||
|
||
sleep(5) | ||
sleep(5) | ||
|
||
lines = None | ||
with open('msg.log','r') as f: | ||
lines = f.readlines() | ||
lines = None | ||
with open('msg.log','r') as f: | ||
lines = f.readlines() | ||
|
||
cnt = 0 | ||
for l in lines: | ||
if c_msg in l: | ||
cnt += 1 | ||
else: | ||
commit_hash = l.split(" ")[0] | ||
cnt -= 1 | ||
break | ||
|
||
cnt = 0 | ||
for l in lines: | ||
if c_msg in l: | ||
cnt += 1 | ||
else: | ||
commit_hash = l.split(" ")[0] | ||
cnt -= 1 | ||
break | ||
|
||
print(f"[+] Reset at HEAD~{cnt}") | ||
print(f"[+] Reset hash = {commit_hash}") | ||
print(f"git reset --soft {commit_hash}") | ||
print(f"git commit -m '{c_msg}'") | ||
|
||
print(f"[+] Reset at HEAD~{cnt}") | ||
print(f"[+] Reset hash = {commit_hash}") | ||
print(f"git reset --soft {commit_hash}") | ||
print(f"git commit -m '{c_msg}'") | ||
if cnt < 1: | ||
print("[+] No Need to Squash! Skipping...") | ||
else: | ||
os.system(f"git reset --soft HEAD~{cnt}") | ||
os.system(f"git commit -m '{c_msg}'") | ||
os.system(f"git push -f") | ||
|
||
if cnt < 1: | ||
print("[+] No Need to Squash! Skipping...") | ||
else: | ||
os.system(f"git reset --soft HEAD~{cnt}") | ||
os.system(f"git commit -m '{c_msg}'") | ||
os.system(f"git push -f") | ||
os.remove("msg.log") | ||
sleep(5) | ||
|
||
os.remove("msg.log") | ||
sleep(5) | ||
print("[+] === SQUASHING COMMITS : DONE ===") | ||
|
||
print("[+] === SQUASHING COMMITS : DONE ===") | ||
except Exception as e: | ||
print(f"Error while squashing commits - Skipping this step!\n{e}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,4 @@ jobs: | |
git config user.email [email protected] | ||
git fetch | ||
git checkout actions-data-download | ||
python .github/workflows/squash.py | ||
python .github/workflows/squash.py |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters