Capture and Process Diagnostic and Metric Summary Output in codeql-action/analyze@v2

Open
#1,742 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
github-actions
Domain
ci-cd, security

Research direction

Start by reviewing the github/codeql-action/analyze@v2 action configuration and the workflow output expressions shown in the issue. Determine whether diagnostic and metric summaries are exposed as supported outputs, and define what captured data should indicate workflow success or failure.

Written by the indexing model from the issue text.

Description

I am currently utilizing the github/codeql-action/analyze@v2 action to execute CodeQL analysis within my GitHub Actions workflow. While the action successfully generates diagnostic and metric summary output, I am facing challenges in capturing and processing this output to make decisions regarding the success or failure of the workflow based on critical or warning data.

I have attempted various approaches, such as printing the returned output for debugging purposes and inspecting the log files, but unfortunately, I have not been able to locate any stored logs or find a reliable method to capture the necessary information.

one of the logic I tried

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

- name: Print Output
  run: |
    echo "CodeQL Analysis Output: ${{ steps.codeql.outputs }}"
    echo "${{ steps.codeql.outputs }}"
    echo "${{ steps.codeql.outputs['db-locations'] }}"
    echo "${{ steps.codeql.outputs['sarif-id'] }}"

I would greatly appreciate any guidance or suggestions.

Thanks!

Dominant language
TypeScript
Stars
1.6k
Forks
493
Avg merge
1d 13h
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql-action

All issues in github/codeql-action

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.