From 59219ed392b31d931ec90b98d8d60050d9fe86bf Mon Sep 17 00:00:00 2001 From: David Pine Date: Tue, 30 Jan 2024 17:32:04 -0600 Subject: [PATCH] Try creating the label if one isnt found --- src/ProfanityFilter.Action/ProfanityProcessor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ProfanityFilter.Action/ProfanityProcessor.cs b/src/ProfanityFilter.Action/ProfanityProcessor.cs index 93e0197..7c2bfcf 100644 --- a/src/ProfanityFilter.Action/ProfanityProcessor.cs +++ b/src/ProfanityFilter.Action/ProfanityProcessor.cs @@ -37,7 +37,9 @@ public async Task ProcessProfanityAsync() "The profanity filter GitHub Action only works with issues or pull requests.") }; - var label = isIssueComment ? null : await client.GetLabelAsync(); + var label = isIssueComment + ? null + : await client.GetLabelAsync() ?? await client.CreateLabelAsync(); if (label is null && isIssueComment is false) { core.Warning("""