mirror of
https://github.com/AllSpiceIO/post-dr-comment.git
synced 2025-04-03 05:16:33 +00:00
Raise a clearer error if design review number is not set
If `post-dr-comment` is called in a run which is not on a design review, the DR number is not set in the context. This previously led to an incomprehensible error. This commit checks early to make sure the design review number is set and errors with an explanation if it isn't.
This commit is contained in:
parent
cc4eab875e
commit
831bd5cb0f
@ -168,6 +168,11 @@ def main():
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.design_review_number.isdigit():
|
||||
raise ValueError(
|
||||
"Design review number is either not set or not a number; this run may not be on a pull request event?"
|
||||
)
|
||||
|
||||
logger.setLevel(args.log_level.upper())
|
||||
client = AllSpice(
|
||||
args.allspice_hub_url,
|
||||
|
Loading…
Reference in New Issue
Block a user