diff --git a/Project.toml b/Project.toml index 279ec57a..bda8f1ec 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RegistryCI" uuid = "0c95cc5f-2f7e-43fe-82dd-79dbcba86b32" authors = ["Dilum Aluthge ", "Fredrik Ekre "] -version = "4.5.0" +version = "4.5.1" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" @@ -23,7 +23,7 @@ VisualStringDistances = "089bb0c6-1854-47b9-96f7-327dbbe09dca" [compat] GitHub = "5.2" -HTTP = "0.8, 0.9" +HTTP = "0.8, 0.9.1" JSON = "0.19, 0.20, 0.21" RegistryTools = "1.2" StringDistances = "0.9, 0.10" diff --git a/src/TagBot/TagBot.jl b/src/TagBot/TagBot.jl index 284376d6..676baa23 100644 --- a/src/TagBot/TagBot.jl +++ b/src/TagBot/TagBot.jl @@ -84,10 +84,16 @@ function get_repo_notification_issue(repo) filter!(x -> x.pull_request === nothing, issues) return if isempty(issues) @info "Creating new notification issue" - issue = GH.create_issue(repo; auth=AUTH[], params=(; - title=ISSUE_TITLE, - body=ISSUE_BODY, - )) + issue = try + GH.create_issue(repo; auth=AUTH[], params=(; + title=ISSUE_TITLE, + body=ISSUE_BODY, + )) + catch e + occursin("Issues are disabled", e.msg) || rethrow() + @info "Issues are disabled on $repo" + return nothing + end GH.edit_issue(repo, issue; auth=AUTH[], params=(; state="closed")) issue else @@ -131,6 +137,10 @@ function maybe_notify(event, repo, version; cron=false) return end issue = get_repo_notification_issue(repo) + if issue === nothing + @info "Couldn't get notification issue for $repo" + return + end if cron && should_fixup(repo, issue) @info "Opening fixup PR for $repo" open_fixup_pr(repo) diff --git a/test/tagbot-unit.jl b/test/tagbot-unit.jl index a6f44cf2..69bfdb75 100644 --- a/test/tagbot-unit.jl +++ b/test/tagbot-unit.jl @@ -53,11 +53,11 @@ end @testset "get_repo_notification_issue" begin playback("get_repo_notification_issue.bson") do - @test_logs (:info, "Creating new notification issue") begin + @test_logs match_mode=:any (:info, "Creating new notification issue") begin issue = TB.get_repo_notification_issue("christopher-dG/TestRepo") @test issue.number == 11 end - @test_logs (:info, "Found existing notification issue") begin + @test_logs match_mode=:any (:info, "Found existing notification issue") begin issue = TB.get_repo_notification_issue("christopher-dG/TestRepo") @test issue.number == 11 end