Skip to content

Commit 601230f

Browse files
committed
Cleanup return codes
1 parent 12e0a42 commit 601230f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

.github/workflows/process-git-request.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import subprocess
66
import os
77

8-
requestors = {"gvrose8192": ""}
9-
108
def file_prepend(file, str):
119
with open(file, 'r') as fd:
1210
contents = fd.read()
@@ -33,8 +31,7 @@ def process_git_request(fname, target_branch, source_branch, prj_dir):
3331
print(f"Command error output is {err}")
3432
file.write(f"Command error output is {err}")
3533
file.close()
36-
retcode = 0
37-
return retcode
34+
return 1
3835

3936
output_lines = out.split()
4037
# we just want the commit sha IDs
@@ -47,6 +44,7 @@ def process_git_request(fname, target_branch, source_branch, prj_dir):
4744
print(f"Error executing git command: {str(e)}")
4845
file.close()
4946
return 1
47+
return 0
5048

5149
first_arg, *argv_in = sys.argv[1:] # Skip script name in sys.argv
5250

@@ -69,7 +67,7 @@ def process_git_request(fname, target_branch, source_branch, prj_dir):
6967

7068
retcode = process_git_request(fname, target_branch, source_branch, prj_dir)
7169

72-
if retcode != 200:
70+
if retcode != 0:
7371
with open(fname, 'r') as fd:
7472
contents = fd.read()
7573
print(contents)

0 commit comments

Comments
 (0)