File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 run : |
3737 python3 extract_sir_pdf_gemini.py pdfs \
3838 --output-dir analysis_output \
39- --max-new-files ${{ github.event.inputs.max_new_files }}
39+ --max-new-files ${{ github.event.inputs.max_new_files }} \
40+ --allow-file-failures
4041 env :
4142 GEMINI_API_KEY : ${{ secrets.GEMINI_API_KEY }}
4243
Original file line number Diff line number Diff line change @@ -657,6 +657,12 @@ def main() -> int:
657657 action = "store_false" ,
658658 help = "Do not skip annual report PDFs." ,
659659 )
660+ parser .add_argument (
661+ "--allow-file-failures" ,
662+ action = "store_true" ,
663+ default = False ,
664+ help = "Exit with code 0 even if some PDFs fail; failed files are still reported." ,
665+ )
660666 args = parser .parse_args ()
661667
662668 if args .max_new_files < 0 :
@@ -879,7 +885,15 @@ def main() -> int:
879885 print (f"[SUMMARY ALL] { csv_path } " )
880886 print (f"[SUMMARY ALL] { json_path } " )
881887
882- return 1 if failures else 0
888+ if failures :
889+ if args .allow_file_failures :
890+ print (
891+ f"[WARN] Completed with { failures } failed file(s); exiting 0 because --allow-file-failures is set." ,
892+ file = sys .stderr ,
893+ )
894+ return 0
895+ return 1
896+ return 0
883897
884898
885899if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments