diff --git a/CCMenu/Resources/Info.plist b/CCMenu/Resources/Info.plist index 2be6696..c50cbce 100644 --- a/CCMenu/Resources/Info.plist +++ b/CCMenu/Resources/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 20.0 + 20.1 CFBundleURLTypes @@ -34,7 +34,7 @@ CFBundleVersion - 2200.3 + 2201.3 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/CCMenu/Source/Pipeline Window/AddGithubPipeline.swift b/CCMenu/Source/Pipeline Window/AddGithubPipeline.swift index 38d5a78..bdc695d 100644 --- a/CCMenu/Source/Pipeline Window/AddGithubPipeline.swift +++ b/CCMenu/Source/Pipeline Window/AddGithubPipeline.swift @@ -84,7 +84,11 @@ struct AddGithubPipelineSheet: View { private func updatePipeline() { - pipeline.feed.url = String(format: "https://api.github.com/repos/%@/%@/actions/workflows/%@/runs", owner, repository, workflow) + var components = URLComponents() + components.scheme = "https" + components.host = "api.github.com" + components.path = String(format: "/repos/%@/%@/actions/workflows/%@/runs", owner, repository, workflow) + pipeline.feed.url = components.url!.absoluteString pipeline.name = "\(repository) (\(workflow))" } diff --git a/CCMenu/Source/Server Monitor/GithubFeedReader.swift b/CCMenu/Source/Server Monitor/GithubFeedReader.swift index 92a7104..ad14732 100644 --- a/CCMenu/Source/Server Monitor/GithubFeedReader.swift +++ b/CCMenu/Source/Server Monitor/GithubFeedReader.swift @@ -23,7 +23,12 @@ class GithubFeedReader: NSObject, FeedReader { public func updatePipelineStatus() { // TODO: consider making page size configurable to make sure to get a completed/successful - var request = URLRequest(url: URL(string: pipeline.feed.url + "?per_page=5")!) + guard let url = URL(string: pipeline.feed.url + "?per_page=5") else { + pipeline.connectionError = "Invalid URL: " + pipeline.feed.url + delegate?.feedReader(self, didUpdate: pipeline) + return + } + var request = URLRequest(url: url) if let token = pipeline.feed.authToken { request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization") }