ZedThree / clang-tidy-review

Create a pull request review based on clang-tidy warnings
MIT License
88 stars 44 forks source link

fix: artifact download #115

Closed Nerixyz closed 7 months ago

Nerixyz commented 7 months ago

40e754e removed PullRequest.headers(type) which breaks the artifact download:

Traceback (most recent call last):
  File "/usr/local/bin/post", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/site-packages/clang_tidy_review/post.py", line 80, in main
    metadata, review = download_artifacts(pull_request, int(args.workflow_id))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/clang_tidy_review/__init__.py", line 929, in download_artifacts
    "GET", artifact.archive_download_url, headers=pull.headers("json")
                                                  ^^^^^^^^^^^^
AttributeError: 'PullRequest' object has no attribute 'headers'

This refactors the download into a method on PullRequest which gets the appropriate headers.