I have a python script that exits with an error code inside a Github action, but the action still shows a success. I'd like for it to show an error when a non-zero exit code is thrown. Is there anything that should be changed in the script or workflow?
Python script:
import sys
import os
error_code = 256
print(f'error_code: {error_code}')
os._exit(error_code)
# have also tried sys.exit(error_code)
Github Workflow:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: test
run: python3 ./test_error_exit.py