Skip to content

Workflow file for this run

name: "CodeQL CLI Analysis"
on:
pull_request:
branches: [ "main" ]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

Check failure on line 12 in .github/workflows/codeql-cli.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/codeql-cli.yaml

Invalid workflow file

You have an error in your yaml syntax on line 12
- name: Set up Java (required for CodeQL CLI)
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Install CodeQL CLI
run: |
CODEQL_VERSION="2.19.1"
wget https://github.com/github/codeql-cli-binaries/releases/download/v${CODEQL_VERSION}/codeql-linux64.zip
unzip codeql-linux64.zip
sudo mv codeql /usr/local/bin/
echo "CodeQL installed"
- name: Initialize CodeQL database
run: |
codeql database create codeql-db --language=javascript --source-root=node-sample
echo "CodeQL database initialized"
- name: Run CodeQL analysis
run: |
codeql database analyze codeql-db \
--format=sarif-latest \
--output=results.sarif \
- name: Run sarif-to-comment
run: |
npx @security-alert/sarif-to-comment \
--commentUrl "$URL" \
--sarifContentOwner "$OWNER" \
--sarifContentRepo "$REPOSITORY" \
--sarifContentBranch "$BRANCH" \
"$File"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: "codeql_troubleshoot_container"
OWNER: "Perdiga"
URL: "https://github.com/Perdiga/codeql_troubleshoot_container/pull/1"
BRANCH: "main"
File: "./results.sarif"