diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..611fa0a --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @on0t0le diff --git a/GitHubWidget/Services/GitHubService.swift b/GitHubWidget/Services/GitHubService.swift index 31c44ab..78ba9bb 100644 --- a/GitHubWidget/Services/GitHubService.swift +++ b/GitHubWidget/Services/GitHubService.swift @@ -74,7 +74,7 @@ actor GitHubService: GitHubServiceProtocol { private struct PRReview: Decodable { let state: String - let user: GitHubUser + let user: GitHubUser? } private struct CheckRunsResponse: Decodable { @@ -97,7 +97,7 @@ actor GitHubService: GitHubServiceProtocol { let detail = try? JSONDecoder().decode(PRDetail.self, from: data) else { return false } - return !detail.requestedReviewers.isEmpty + return !detail.requestedReviewers.isEmpty || !detail.requestedTeams.isEmpty } func fetchEnrichments(prs: [PullRequest], token: String) async -> [Int: PREnrichment] { @@ -128,10 +128,11 @@ actor GitHubService: GitHubServiceProtocol { var latestByUser: [String: String] = [:] for review in reviews { + guard let login = review.user?.login else { continue } if review.state != "COMMENTED" { - latestByUser[review.user.login] = review.state - } else if latestByUser[review.user.login] == nil { - latestByUser[review.user.login] = review.state + latestByUser[login] = review.state + } else if latestByUser[login] == nil { + latestByUser[login] = review.state } } let approved = latestByUser.values.filter { $0 == "APPROVED" }.count diff --git a/README.md b/README.md index 04c0201..a0d0bd3 100644 --- a/README.md +++ b/README.md @@ -62,40 +62,20 @@ xcodebuild archive \ -archivePath build/GitHubWidget.xcarchive \ ARCHS=arm64 \ ONLY_ACTIVE_ARCH=NO \ - CODE_SIGN_IDENTITY="-" + CODE_SIGN_IDENTITY="-" \ + SKIP_INSTALL=NO \ + INSTALL_PATH=/Applications ``` `CODE_SIGN_IDENTITY="-"` signs ad-hoc (no Apple Developer account needed). For notarization, replace with your Developer ID identity. -### 3. Export the .app +`SKIP_INSTALL=NO` + `INSTALL_PATH=/Applications` are already set in `project.yml` — these flags are shown for clarity and can be omitted. -```bash -xcodebuild -exportArchive \ - -archivePath build/GitHubWidget.xcarchive \ - -exportPath build/export \ - -exportOptionsPlist ExportOptions.plist -``` - -Create `ExportOptions.plist` in the repo root: - -```xml - - - - - method - mac-application - destination - export - - -``` - -### 4. Package with pkgbuild +### 3. Package with pkgbuild ```bash mkdir -p build/pkg-root/Applications -ditto build/export/GitHubWidget.app build/pkg-root/Applications/GitHubWidget.app +ditto build/GitHubWidget.xcarchive/Products/Applications/GitHubWidget.app build/pkg-root/Applications/GitHubWidget.app pkgbuild \ --root build/pkg-root \ @@ -107,7 +87,7 @@ pkgbuild \ The `.pkg` installs `GitHubWidget.app` to `/Applications`. -### 5. (Optional) Sign and notarize +### 4. (Optional) Sign and notarize Sign the package with a Developer ID Installer certificate: diff --git a/project.yml b/project.yml index f00c851..5d30b69 100644 --- a/project.yml +++ b/project.yml @@ -16,6 +16,8 @@ targets: ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon MARKETING_VERSION: "1.1.1" CURRENT_PROJECT_VERSION: "1" + SKIP_INSTALL: NO + INSTALL_PATH: /Applications info: path: GitHubWidget/Info.plist properties: