Skip to content

Provide a way to pass a whole configuration as parameter #1589

Closed
@tgrall

Description

Problem

As a user of GitHub CodeQL in Actions I would like to be able to pass some configuration when running my workflow, for example:

  • pass a query filter from or environment variable or input parameter

Today only a subset of the available configuration/parameters is available in the action.

Solution

Add a new parameter, for example called configuration that will take the same format as a config-file but can be used directly in the action.

The idea is to support the following examples:

  • Complete on configuration

    - uses: github/codeql-action/init@v2
      with:
        languages: ${{ matrix.language }}
        configuration: |
          disable-default-queries: true
          queries:
            - uses: security-extended
            - uses: security-and-quality
          query-filters:
            - include:
          tags: /cwe-020/
  • Actions Variable

    - uses: github/codeql-action/init@v2
      with:
        languages: ${{ matrix.language }}
        configuration: |
              ${{vars.CODEQL_CONF}}    
  • Input Parameter

      - uses: tgrall/codeql-action/init@query-filter
      with:
        languages: ${{ matrix.language }}
        configuration: |
          disable-default-queries: true
          queries:
            - uses: security-extended
            - uses: security-and-quality
          query-filters:
            - include:
                tags: /${{ github.event.inputs.codeql-include-tags }}/ 

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions