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: 10 additions & 3 deletions .github/actions/scan-with-codeql/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,44 @@ inputs:
maven-version:
description: The Maven version to use for the build.
required: true
language:
description: The CodeQL language to analyze (java-kotlin or actions).
required: true

runs:
using: composite
steps:
- name: Set up Java ${{ inputs.java-version }}
if: inputs.language == 'java-kotlin'
Comment thread
Schmarvinius marked this conversation as resolved.
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: ${{ inputs.java-version }}
distribution: sapmachine
cache: maven

- name: Set up Maven ${{ inputs.maven-version }}
if: inputs.language == 'java-kotlin'
Comment thread
Schmarvinius marked this conversation as resolved.
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: ${{ inputs.maven-version }}

- name: Initialize CodeQL
uses: github/codeql-action/init@ed410739ba306e4ebe5e123421a6bd694e494a2b # v4
with:
languages: java-kotlin
build-mode: manual
languages: ${{ inputs.language }}
build-mode: ${{ inputs.language == 'java-kotlin' && 'manual' || 'none' }}

- name: Install @sap/cds-dk
if: inputs.language == 'java-kotlin'
Comment thread
Schmarvinius marked this conversation as resolved.
run: npm i -g @sap/cds-dk@9.9.1
shell: bash

- name: Build Java code
if: inputs.language == 'java-kotlin'
Comment thread
Schmarvinius marked this conversation as resolved.
run: mvn clean compile -B -ntp -Dcds.install-node.skip
shell: bash

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@ed410739ba306e4ebe5e123421a6bd694e494a2b # v4
with:
category: "/language:java-kotlin"
category: "/language:${{ inputs.language }}"
7 changes: 6 additions & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,18 @@ jobs:
github-token: ${{ secrets.GH_TOKEN }}

codeql:
name: CodeQL Analysis
name: CodeQL Analysis (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
language: [java-kotlin, actions]
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Expand All @@ -145,3 +149,4 @@ jobs:
with:
java-version: 17
maven-version: ${{ env.MAVEN_VERSION }}
language: ${{ matrix.language }}
Loading