Skip to content

Kotlin example

Kotlin example #15

name: "Code Scanning - Action"
on:
push:
branches: [ main ]
env:
WORKSPACE: /home/runner/work
CODEQL_HOME: /home/runner/work/codeql-home
CODEQL_URL: https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.16.4/codeql-bundle-linux64.tar.gz
jobs:
CodeQL-Build:
# If you're only analyzing JavaScript or Python, CodeQL runs on ubuntu-latest, windows-latest, and macos-latest.
# If you're analyzing C/C++, C#, Go, or Java, CodeQL runs on ubuntu-latest, windows-2019, and macos-latest.
runs-on: ubuntu-latest
permissions:
security-events: write
# only required for workflows in private repositories
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: bazelbuild/setup-bazelisk@v1
- name: Setup Required Directories and Files
run: |
cd ${{ env.WORKSPACE }}
mkdir ${{ env.CODEQL_HOME }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: java
debug: true
tools: ${{ env.CODEQL_URL }}
- run: |
USE_BAZEL_VERSION=7.0.0 bazel build --spawn_strategy=local --nouse_action_cache --noremote_accept_cached --noremote_upload_local_results //src/main/java/com/example:example
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3