Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli,action): when process fails, make exit code 1 (#81)
**Assumptions**: To my knowledge, in order to get a step to fail, the process exit code has to be 1: https://docs.github.com/en/actions/creating-actions/setting-exit-codes-for-actions **Scenario:** Currently when the node process fails, it always exits with code 0. Tested by running local script: ``` if code-suggester pr \ --upstream-repo="dne" \ --upstream-owner="TomKristie" \ --description="describe" \ --title="title" \ --branch="something" \ --primary="master" \ --message="some message" \ --git-dir="./kubernetes"; then exit 0 else echo "failure exit code non-zero" exit 1 fi ``` which tries to fork a non-existent repo. The output is ``` {"level":30,"time":1597342089072,"pid":8411,"hostname":"penguin","msg":"Starting GitHub PR workflow..."} {"level":50,"time":1597342089474,"pid":8411,"hostname":"penguin","msg":"Error when forking"} {"level":50,"time":1597342089474,"pid":8411,"hostname":"penguin","msg":"Workflow failed"} {"level":50,"time":1597342089474,"pid":8411,"hostname":"penguin","stack":"Error: HttpError: Not Found\n at Object.fork (/home/kristietom/code-suggester/build/src/github-handler/fork-handler.js:44:15)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)\n at async Object.createPullRequest (/home/kristietom/code-suggester/build/src/index.js:59:20)\n at async Object.main (/home/kristietom/code-suggester/build/src/bin/workflow.js:42:17)","type":"Error","msg":"HttpError: Not Found"} failure exit code non-zero ``` Fixes #72 🦕
- Loading branch information