Skip to content

Commit 5bfba71

Browse files
committed
Update main.py
return proper status codes to fail workflow
1 parent 905596d commit 5bfba71

File tree

1 file changed

+5
-5
lines changed
  • .github/actions/log_to_splunk

1 file changed

+5
-5
lines changed

.github/actions/log_to_splunk/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,25 @@ def main():
3535
output = "GITHUB API Http Error:" + str(errh)
3636
print(f"Error: {output}")
3737
print(f"::set-output name=result::{output}")
38-
return
38+
return x.status_code
3939
except requests.exceptions.ConnectionError as errc:
4040
output = "GITHUB API Error Connecting:" + str(errc)
4141
print(f"Error: {output}")
4242
print(f"::set-output name=result::{output}")
43-
return
43+
return x.status_code
4444
except requests.exceptions.Timeout as errt:
4545
output = "Timeout Error:" + str(errt)
4646
print(f"Error: {output}")
4747
print(f"::set-output name=result::{output}")
48-
return
48+
return x.status_code
4949
except requests.exceptions.RequestException as err:
5050
output = "GITHUB API Non catched error conecting:" + str(err)
5151
print(f"Error: {output}")
5252
print(f"::set-output name=result::{output}")
53-
return
53+
return x.status_code
5454
except Exception as e:
5555
print("Internal error", e)
56-
return None
56+
return x.status_code
5757

5858
summary = x.json()
5959

0 commit comments

Comments
 (0)