Can I make the configuration for the analysis in php? on codeQL

162 views Asked by At

I have this error, I read that it can be configured to scan php code, but it fails. What am I doing wrong?

Languages from configuration: php Error: Did not recognize the following languages: php

name: "CodeQL"

on: push: branches: [ "main" ] pull_request: # The branches below must be a subset of the branches above branches: [ "main" ] schedule: - cron: '21 0 * * 4'

jobs: analyze: name: Analyze

runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
  actions: read
  contents: read
  security-events: write

strategy:
  fail-fast: false
  matrix:
    language: [ 'javascript-typescript' ]

steps:
- name: Checkout repository
  uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
  uses: github/codeql-action/init@v2
  with:
    languages: php
 

actions#jobsjob_idstepsrun

below for guidance.

- name: Perform CodeQL Analysis
  uses: github/codeql-action/analyze@v2
  with:
    category: "/language:${{matrix.language}}"
1

There are 1 answers

0
Marcono1234 On

CodeQL does not support PHP at the moment, see Supported languages and frameworks and this question asking for PHP support.

However, you can set up other tools for GitHub Code Scanning which support PHP. Some examples are:

(I am not familiar with PHP development, so I cannot say how good these tools listed above are, and if there are better alternatives.)

In your GitHub repository, when you go to "Settings" > "Code security and analysis" > "Code scanning" > "Other tools", "Explore workflows" you can see more code scanning tools (not all of them support PHP though).