Skip to content

Commit cd7c323

Browse files
committed
Explicit exit codes in GitHub Action
1 parent e806c2c commit cd7c323

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Diff for: .github/workflows/cron-wishlist.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,16 @@ jobs:
3838
run: |
3939
output=$(deno run --allow-net --allow-read --allow-env ./script/fetch-kobo-wishlist.ts)
4040
ec=$?
41-
[[ $ec -eq 0 && -n "$output" ]] && \
42-
echo "$output" >> "$reading_list" || ([[ $ec -eq 10 ]] && echo "$output")
41+
if [[ $ec -eq 0 && -n "$output" ]]; then
42+
echo "$output" >> "$reading_list"
43+
exit 0
44+
elif [[ $ec -eq 10 ]]; then
45+
echo "$output"
46+
exit 0 # Explicitly exit with success code
47+
else
48+
echo "Error: Unexpected exit code $ec"
49+
exit $ec # Pass through any unexpected error codes
50+
fi
4351
env:
4452
reading_list: ${{ env.READING_LIST_PATH }}
4553
KOBO_ACCESS_TOKEN: ${{ secrets.KOBO_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)