Skip to content

ci(codeql): portable enterprise CodeQL security baseline#7

Merged
thefourcraft merged 2 commits into
Productionfrom
ci/codeql-baseline
Jun 28, 2026
Merged

ci(codeql): portable enterprise CodeQL security baseline#7
thefourcraft merged 2 commits into
Productionfrom
ci/codeql-baseline

Conversation

@thefourcraft

Copy link
Copy Markdown
Member

Hosts the org-wide CodeQL security baseline workflow. Self-detecting (scans only languages present) and builds native iOS apps automatically (XcodeGen + xcodebuild). Referenced by the enterprise ruleset that requires CodeQL across all orgs. See jomalabs/platform#1243.

Comment on lines +48 to +80
name: Detect languages
runs-on: ubuntu-latest
outputs:
source_langs: ${{ steps.detect.outputs.source_langs }}
has_swift: ${{ steps.detect.outputs.has_swift }}
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6

- name: Detect languages
id: detect
run: |
set -euo pipefail
ex='-not -path */node_modules/* -not -path */.git/* -not -path */vendor/* -not -path */Pods/*'
present() { [ -n "$(eval find . $ex -type f \\( $1 \\) -print -quit)" ]; }

langs=('"actions"') # every repo has workflow files
present '-name *.ts -o -name *.tsx -o -name *.js -o -name *.jsx -o -name *.mjs' && langs+=('"javascript-typescript"')
present '-name *.py' && langs+=('"python"')
present '-name *.kt -o -name *.kts -o -name *.java' && langs+=('"java-kotlin"')

IFS=,; echo "source_langs=[${langs[*]}]" >> "$GITHUB_OUTPUT"; unset IFS

if [ -n "$(eval find . $ex -type f \( -name *.xcodeproj -o -name *.xcworkspace -o -name project.yml -o -name Package.swift -o -name *.swift \) -print -quit)" ]; then
echo "has_swift=true" >> "$GITHUB_OUTPUT"
else
echo "has_swift=false" >> "$GITHUB_OUTPUT"
fi

# ---------------------------------------------------------------------------
# Source-only languages (build-mode:none) — one ubuntu runner.
# ---------------------------------------------------------------------------
analyze:
@thefourcraft thefourcraft merged commit 518b958 into Production Jun 28, 2026
5 of 6 checks passed
@thefourcraft thefourcraft deleted the ci/codeql-baseline branch June 28, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants