Skip to content

Conversation

@go-while
Copy link
Owner

Updated the GitHub Actions workflow to implement CodeQL analysis and adjust job configurations.

Updated the GitHub Actions workflow to implement CodeQL analysis and adjust job configurations.
Copilot AI review requested due to automatic review settings October 14, 2025 17:02
@go-while go-while merged commit aa0e922 into main Oct 14, 2025
3 of 8 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the GitHub Actions workflow to implement CodeQL analysis for security scanning instead of building and publishing binaries. The workflow is transformed from a complex multi-platform build system to a focused security analysis pipeline.

Key changes:

  • Replaced build matrix with CodeQL analysis matrix targeting Go, C/C++, and Actions languages
  • Simplified workflow steps to focus on CodeQL initialization, building, and analysis
  • Removed extensive build, test, and packaging logic for multiple platforms

Comment on lines +104 to +109
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: ${{ matrix.language == 'c-cpp' && 'security-extended' || 'security-extended,security-and-quality' }}
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ternary operator syntax using && and || in YAML expressions can be confusing and error-prone. Consider using a more explicit conditional structure or separate matrix entries for different query configurations.

Suggested change
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: ${{ matrix.language == 'c-cpp' && 'security-extended' || 'security-extended,security-and-quality' }}
- name: Set CodeQL queries
id: set-queries
run: |
if [ "${{ matrix.language }}" = "c-cpp" ]; then
echo "queries=security-extended" >> $GITHUB_OUTPUT
else
echo "queries=security-extended,security-and-quality" >> $GITHUB_OUTPUT
fi
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: ${{ steps.set-queries.outputs.queries }}

Copilot uses AI. Check for mistakes.
uses: github/codeql-action/autobuild@v3

- name: Build (manual, for C/C++)
if: matrix.language == 'c-cpp' && matrix.build-mode != 'autobuild'
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition checks for build-mode != 'autobuild' but the C/C++ matrix entry uses build-mode: manual. Consider using a positive check matrix.build-mode == 'manual' for better clarity and maintainability.

Suggested change
if: matrix.language == 'c-cpp' && matrix.build-mode != 'autobuild'
if: matrix.language == 'c-cpp' && matrix.build-mode == 'manual'

Copilot uses AI. Check for mistakes.
ram: ${{ matrix.ram }}

- name: Autobuild
if: matrix.language == 'go' && matrix.build-mode == 'autobuild'
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is redundant since both Go matrix entries have build-mode: autobuild. The step could simply use if: matrix.language == 'go' for better readability.

Suggested change
if: matrix.language == 'go' && matrix.build-mode == 'autobuild'
if: matrix.language == 'go'

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants