Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/sync-status/local-push.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"timestamp": "2025-07-31 23:00:07 UTC",
"branch": "fix/pr-validation-check-changed-files",
"commit": "8677efd1f17264fe17c796320fac412fe9c149f1",
"message": "fix(ci): Only run Swift checks on PRs with Swift changes

- Check if PR contains Swift file changes before running SwiftLint
- Skip Swift-specific checks (TODO/FIXME, security) for non-Swift PRs
- Fixes CI failures on workflow-only PRs like #244-#248

This properly handles PRs that only modify workflows, scripts, or
documentation without triggering Swift-related validations."
}
32 changes: 22 additions & 10 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,27 @@ jobs:
brew install swiftlint
fi

- name: Run SwiftLint
- name: Check PR for Swift files
id: check_swift_changes
run: |
# Check if there are any Swift files in the PR
SWIFT_FILES=$(find . -name "*.swift" -not -path "*/.*" | head -n 1)
# Get list of changed files in the PR
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)

if [ -z "$SWIFT_FILES" ]; then
echo "No Swift files found in repository, skipping SwiftLint"
exit 0
fi
# Check if any changed files are Swift files
SWIFT_CHANGES=$(echo "$CHANGED_FILES" | grep '\.swift$' || true)

if [ -z "$SWIFT_CHANGES" ]; then
echo "No Swift files changed in this PR"
echo "has_swift_changes=false" >> $GITHUB_OUTPUT
else
echo "Swift files changed in this PR:"
echo "$SWIFT_CHANGES"
echo "has_swift_changes=true" >> $GITHUB_OUTPUT
fi

- name: Run SwiftLint
if: steps.check_swift_changes.outputs.has_swift_changes == 'true'
run: |
if [ -f .swiftlint.yml ]; then
swiftlint lint --reporter github-actions-logging --config .swiftlint.yml
else
Expand Down Expand Up @@ -88,7 +99,8 @@ jobs:
- name: Check if Swift project
id: check_swift
run: |
if [ -f "project.yml" ] && [ -n "$(find . -name "*.swift" -not -path "*/.*" | head -n 1)" ]; then
# Use the result from check_swift_changes step
if [ "${{ steps.check_swift_changes.outputs.has_swift_changes }}" == "true" ]; then
echo "is_swift=true" >> $GITHUB_OUTPUT
else
echo "is_swift=false" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -147,7 +159,7 @@ jobs:
fi

- name: Check for TODO and FIXME comments
if: steps.check_swift.outputs.is_swift == 'true'
if: steps.check_swift_changes.outputs.has_swift_changes == 'true'
Comment on lines 161 to +162
Copy link

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition references steps.check_swift_changes but the step with id check_swift_changes is defined in a different job. The TODO/FIXME check job needs to either have its own Swift file detection step or reference the correct step id from the current job context.

Copilot uses AI. Check for mistakes.
run: |
todos=$(find . -name "*.swift" -not -path "./.*" -exec grep -n "TODO\|FIXME" {} + | wc -l)
echo "Found $todos TODO/FIXME comments"
Expand All @@ -156,7 +168,7 @@ jobs:
fi

- name: Security checks
if: steps.check_swift.outputs.is_swift == 'true'
if: steps.check_swift_changes.outputs.has_swift_changes == 'true'
Copy link

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition references steps.check_swift_changes but the step with id check_swift_changes is defined in a different job. The security checks job needs to either have its own Swift file detection step or reference the correct step id from the current job context.

Copilot uses AI. Check for mistakes.
run: |
# Check for potential security issues
echo "Running basic security checks..."
Expand Down
47 changes: 47 additions & 0 deletions .xcode-diagnostics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"swift_flags": {
"debug": [
"-Xfrontend", "-warn-long-function-bodies=150",
"-Xfrontend", "-warn-long-expression-type-checking=150",
"-Xfrontend", "-debug-time-function-bodies",
"-Xfrontend", "-debug-time-expression-type-checking",
"-Xfrontend", "-print-stats",
"-Xfrontend", "-validate-tbd-against-ir=all"
],
"release": [
"-Xfrontend", "-warn-long-function-bodies=200"
]
},
"analysis_thresholds": {
"max_function_body_time_ms": 150,
"max_expression_type_check_ms": 150,
"max_file_compile_time_s": 10
},
"required_tools": [
"xcbeautify",
"xclogparser",
"swiftlint",
"swiftformat"
],
"diagnostic_settings": {
"continue_building_after_errors": false,
"treat_warnings_as_errors_debug": true,
"treat_warnings_as_errors_release": false,
"enable_link_map": true,
"enable_build_timing": true
},
"module_specific_thresholds": {
"FeaturesScanner": {
"max_function_body_time_ms": 200,
"max_expression_type_check_ms": 200
},
"ServicesSync": {
"max_function_body_time_ms": 250,
"max_expression_type_check_ms": 250
},
"FeaturesReceipts": {
"max_function_body_time_ms": 200,
"max_expression_type_check_ms": 200
}
}
}
Loading