Skip to content

Guard and record the condition behind the CodeQL Actions failure - #8

Merged
jikovec merged 1 commit into
mainfrom
claude/codeql-actions-input-20261127
Nov 27, 2026
Merged

jikovec merged 1 commit into
mainfrom
claude/codeql-actions-input-20261127

Conversation

@jikovec

@jikovec jikovec commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Work object

Closes #4.

Authority basis

The repository owner's direct task request of 2026-11-27 to fix Issue #4 and open a pull request onto main, carried out under this repository's standing ordinary-workflow grant (.agent/contracts/authorization.md). The request covers a branch and a pull request; merging is left to the owner. No merge, settings or release authority is exercised.

Executor

Claude Code (Fable 5.2), in a direct owner session.

Outcome

Cause. CodeQL default setup was analysing GitHub Actions. That analysis reads workflows in .github/workflows/ and .github/reusable_workflows/ and action files such as action.yml. From the 2026-09-12 revision of main (5239dbe) through 53e89cc, the only Actions file in the repository was workflow-templates/repository-hygiene.yml, which is outside those paths. Extraction therefore found nothing, and codeql database finalize exits 32 with "CodeQL detected code written in GitHub Actions but could not process any of it" instead of reporting an empty result. The failing job shows the extraction step listing no file.

Current state. The failure no longer occurs. #5 added .github/workflows/agent-toolkit.yml on 2026-10-07, which gave the analysis a file to read. Analyze (actions) has passed on every run since 2026-10-09, most recently on main at 257385c in this run, where it extracted that one workflow and uploaded no alerts. The repair was a side effect: nothing in the repository recorded why the analysis passes or what would break it again.

Change.

  • scripts/validate_agent_toolkit.py requires at least one *.yml or *.yaml workflow directly under .github/workflows/.
  • tests/test_agent_toolkit.py gains two cases. The layout that failed (a workflow template and no workflow, with the directory empty and with it absent) is rejected. A workflow with the .yaml suffix is accepted.
  • .agent/integrations/README.md records that code scanning is default setup with no tracked file, which paths its Actions analysis reads, that workflow-templates/ is not analysed, and why the validator has the check.

No CodeQL setting, language, query suite or workflow is changed. GitHub Actions analysis stays enabled.

Verification

Checks run and results (local, at fae0e1a, Python 3.13 with PyYAML via nix-shell -p python3Packages.pyyaml):

  • python3 scripts/validate_agent_toolkit.py: passed.
  • python3 -m unittest discover -s tests -v: 15 tests passed, two of them new. The new rejecting test failed (Invalid not raised) before the validator change, so it exercises the check.
  • git diff --check: clean.
  • The validator run end to end on a file copy of this branch with the workflow removed and only the template left: exit 1, no workflow under .github/workflows/ for code scanning to analyze.
  • The check's condition compared with every recorded CodeQL Actions analysis whose commit is in the current history (5239dbe, 047433e, d77fc31, 53e89cc, b33b0a6, 4ea2424, 257385c): it rejects the four trees where the analysis failed and accepts the three where it succeeded.
  • The paths the Actions analysis reads were taken from the extractor's source at the CodeQL version used by the passing run (2.27.6), not from memory.

Hosted checks observed at head fae0e1a:

  • Agent toolkit: passed. The validator passed and 15 tests ran, including both new cases.
  • CodeQL: Analyze (actions) and Analyze (python) passed, with no alerts on this pull request.

Checks not run and why:

  • CodeQL on main after merge. It runs on the merge push; this pull request is not merged.
  • Why default setup was analysing GitHub Actions in a repository without workflows is not established. The setting's history is not readable from the repository.

Documentation impact

.agent/integrations/README.md gains one paragraph on code scanning. It is descriptive: no contract, authority or workflow rule changes.

Security and privacy

No protection is weakened or removed. No setting, language, query suite, permission or dependency changes; the code-scanning, secret-scanning and Dependabot settings were read before the change and left untouched.

The new paragraph states a coverage limit that already existed: workflow-templates/ gets no CodeQL analysis here, so template edits rely on the manual inspection the public metadata workflow already requires. No credentials or private details are added.

Compatibility and rollout

The validator now fails for a tree with no workflow under .github/workflows/. If GitHub Actions analysis is later switched off on purpose, remove the check in that same reviewed change. To roll back, revert this commit.

Deployment effect

None. Merging runs the read-only Agent toolkit workflow and CodeQL default setup on main. It deploys, publishes or releases nothing and changes no organization default community file.

Explicit non-actions

  • Not merged.
  • No code-scanning, secret-scanning, Dependabot or other setting changed.
  • CodeQL was not moved from default to advanced setup, and workflow-templates/ was not brought under CodeQL analysis. Either would be a separate change.
  • Issue CodeQL default setup fails to analyze GitHub Actions on main #4 was not edited or closed by hand.

Checklist

  • The change is limited to its stated work object and scope.
  • Acceptance criteria are reconciled.
  • Documentation is updated where needed.
  • No credentials, personal data, private source, or inappropriate internal details are included in a public location.
  • Discovered material work is tracked separately instead of silently widening this PR. (No new work object: the template coverage limit is documented, not acted on.)

CodeQL default setup failed on main from 2026-09-12 to 2026-09-30 because
its GitHub Actions analysis had no input: the only Actions file was a
workflow template, which that analysis does not read. Adding the toolkit
workflow repaired it as a side effect. Check the condition in the validator
and record it with the GitHub integration.

Refs #4
@jikovec
jikovec marked this pull request as ready for review November 27, 2026 17:05
@jikovec
jikovec merged commit 8e6e208 into main Nov 27, 2026
4 checks passed
@jikovec
jikovec deleted the claude/codeql-actions-input-20261127 branch November 27, 2026 17:40
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.

CodeQL default setup fails to analyze GitHub Actions on main

1 participant