diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7b24257..d6316b47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,22 +60,27 @@ jobs: - name: Find Analyzed Warnings if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' }} + id: findwarnings env: DEVELOPER_DIR: ${{ matrix.xcode-path }} run: | - grep -q "warning:" anaylze_output.txt + if grep -q "warning:" anaylze_output.txt; then + echo '::set-output name=analyzestatus::0' + else + echo '::set-output name=analyzestatus::1' + fi - name: Extract Analyzed Warnings - if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' }} + if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' && steps.findwarnings.outputs.analyzestatus == '0' }} id: warnings run: | echo ::set-output name=content::$(cat anaylze_output.txt) - name: Post Analyzed Warnings - if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' }} + if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' && steps.findwarnings.outputs.analyzestatus == '0' }} uses: mshick/add-pr-comment@v1 with: - allow-repeats: true + allow-repeats: false repo-token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }} repo-token-user-login: 'Sparkle-Bot' message: "``` ${{ steps.warnings.outputs.content }} ```" diff --git a/Sparkle/SPUUpdater.m b/Sparkle/SPUUpdater.m index 1d4ce71f..4c78fd83 100644 --- a/Sparkle/SPUUpdater.m +++ b/Sparkle/SPUUpdater.m @@ -225,7 +225,9 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification NSURL *xpcServiceBundleURL = [[self.sparkleBundle.bundleURL URLByAppendingPathComponent:@"XPCServices"] URLByAppendingPathComponent:xpcServiceBundleName]; if (![xpcServiceBundleURL checkResourceIsReachableAndReturnError:NULL]) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInvalidUpdaterError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"XPC Service is enabled (%@) but does not exist: %@", xpcServiceEnabledKey, xpcServiceBundleURL.path] }]; + if (error != NULL) { + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInvalidUpdaterError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"XPC Service is enabled (%@) but does not exist: %@", xpcServiceEnabledKey, xpcServiceBundleURL.path] }]; + } return NO; } @@ -235,7 +237,9 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification NSURL *mainBundleXPCServiceURL = [[[mainBundle.bundleURL URLByAppendingPathComponent:@"Contents"] URLByAppendingPathComponent:@"XPCServices"] URLByAppendingPathComponent:xpcServiceBundleName]; if ([mainBundleXPCServiceURL checkResourceIsReachableAndReturnError:NULL]) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInvalidUpdaterError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"XPC Service (%@) must be in the Sparkle framework, not in the application bundle (%@). Please visit https://sparkle-project.org/documentation/sandboxing/ for up to date Sandboxing instructions.", xpcServiceBundleName, mainBundleXPCServiceURL.path] }]; + if (error != NULL) { + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInvalidUpdaterError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"XPC Service (%@) must be in the Sparkle framework, not in the application bundle (%@). Please visit https://sparkle-project.org/documentation/sandboxing/ for up to date Sandboxing instructions.", xpcServiceBundleName, mainBundleXPCServiceURL.path] }]; + } return NO; }