Skip to content

add git codeql action #8

add git codeql action

add git codeql action #8

Workflow file for this run

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '38 13 * * 4'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: python
build-mode: none
- language: swift
build-mode: autobuild
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Skip installing CocoaPods since pods are already in the repo
- name: Use existing CocoaPods setup
if: matrix.language == 'swift'
run: |
echo "Pods are already installed, skipping pod install"
# Initializes the CodeQL tools for scanning
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# Build the Swift project for physical device (no simulator)
- name: Build Swift project for physical device
if: matrix.language == 'swift'
run: |
xcodebuild -workspace WarDragon.xcworkspace -scheme WarDragon -destination 'platform=iOS,name=iPhone' -configuration Debug build
# Perform CodeQL Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"