-
Notifications
You must be signed in to change notification settings - Fork 59
Add CodeQL Advanced workflow for security analysis #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
98e0ddd
Add CodeQL Advanced workflow for security analysis
marandaneto e4b039e
Fix Swift CodeQL: use autobuild mode with Flutter/Xcode setup
marandaneto 06b52ba
Allow github/ actions in security allowlist, update example config
marandaneto 3627c74
Revert example/lib/main.dart changes
marandaneto 22e994e
Fix Java/Kotlin CodeQL: use manual build mode with Flutter APK build
marandaneto 896d699
Fix Swift CodeQL: use manual build mode with flutter build ios
marandaneto ee3322d
Fix Swift CodeQL: use xcodebuild for proper Swift tracing
marandaneto 5f3d3be
Use generic iOS Simulator destination for xcodebuild
marandaneto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,3 +27,4 @@ jobs: | |
| allowlist: | | ||
| actions/ | ||
| PostHog/ | ||
| github/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| name: "CodeQL Advanced" | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: ${{ matrix.runner }} | ||
| permissions: | ||
| security-events: write | ||
| packages: read | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - language: java-kotlin | ||
| build-mode: manual | ||
| runner: ubuntu-latest | ||
| - language: swift | ||
| build-mode: manual | ||
| runner: macos-latest | ||
| - language: actions | ||
| build-mode: none | ||
| runner: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup Flutter (Swift) | ||
| if: matrix.language == 'swift' | ||
| uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2.21.0 | ||
| with: | ||
| channel: 'stable' | ||
|
|
||
| - name: Setup Xcode (Swift) | ||
| if: matrix.language == 'swift' | ||
| uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | ||
| with: | ||
| xcode-version: '16.4' | ||
|
|
||
| - name: Install dependencies (Swift) | ||
| if: matrix.language == 'swift' | ||
| run: | | ||
| flutter pub get | ||
| cd example | ||
| flutter pub get | ||
|
|
||
| - name: Setup Java (Java/Kotlin) | ||
| if: matrix.language == 'java-kotlin' | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: 17 | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Setup Flutter (Java/Kotlin) | ||
| if: matrix.language == 'java-kotlin' | ||
| uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2.21.0 | ||
| with: | ||
| channel: 'stable' | ||
|
|
||
| - name: Install dependencies (Java/Kotlin) | ||
| if: matrix.language == 'java-kotlin' | ||
| run: | | ||
| flutter pub get | ||
| cd example | ||
| flutter pub get | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v4 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: ${{ matrix.build-mode }} | ||
| queries: security-and-quality | ||
|
|
||
| - name: Build Android (Java/Kotlin) | ||
| if: matrix.language == 'java-kotlin' | ||
| working-directory: ./example | ||
| run: flutter build apk | ||
|
|
||
| - name: Build iOS (Swift) | ||
| if: matrix.language == 'swift' | ||
| working-directory: ./example | ||
| run: | | ||
| flutter build ios --simulator --no-codesign --config-only | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need this to generate the xcode project |
||
| cd ios | ||
| pod install | ||
| xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' build | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v4 | ||
| with: | ||
| category: '/language:${{matrix.language}}' | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
macos-14-xlargeif you want this to go way faster