Uh oh!
There was an error while loading. Please reload this page.
Add repository property for configuration files - #3963
Conversation
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Pull request overview
This PR introduces a new repository property (github-codeql-config-file) that can provide the CodeQL configuration file location when no explicit config-file workflow input is set, with the workflow input taking precedence. It wires this selection into the init action and adds unit tests around property loading and the selection logic.
Changes:
- Add
RepositoryPropertyName.CONFIG_FILEand parse it from the repository properties API response. - Add
getConfigFileInput()to resolve the effective config file location (workflow input first, otherwise repository property) and use it frominit-action. - Add small test utilities and unit tests for both repository property parsing and config file resolution.
Show a summary per file
| File | Description |
|---|---|
| src/actions-util.ts | Adds an ActionsEnv abstraction and getActionsEnv() to avoid stubbing globals in tests. |
| src/init-action.ts | Uses repository properties + getConfigFileInput() to determine configFile instead of reading the input directly. |
| src/feature-flags/properties.ts | Adds the new github-codeql-config-file repository property to the known/parsed property set. |
| src/feature-flags/properties.test.ts | Extends coverage to ensure the new property is loaded and returned from the API response. |
| src/config/file.ts | New helper for resolving the effective config file from workflow input vs repository property. |
| src/config/file.test.ts | Adds unit tests validating precedence and logging for config file resolution. |
| src/testing-utils.ts | Adds a helper to construct an ActionsEnv for tests. |
| lib/entry-points.js | Excluded from diff (generated/contents unavailable per policy). |
Copilot's findings
Files excluded by content exclusion policy (1)
- lib/entry-points.js
- Files reviewed: 7/8 changed files
- Comments generated: 4
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mario-campos
left a comment
There was a problem hiding this comment.
LGTM with one minor comment/question.
Uh oh!
There was an error while loading. Please reload this page.
This PR is the first in a series of changes which will add the ability to point the CodeQL Action at a configuration file using a repository property.
This PR adds the new repository property and uses its value, if provided and no explicit
config-fileinput is provided for the CodeQL Action in the workflow. In other words, theconfig-fileinput has priority over the value of the repository property.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, Code Quality, ...).Products:
analysis-kinds: code-scanning.analysis-kinds: code-quality.Environments:
github.comand/or GitHub Enterprise Cloud with Data Residency.How did/will you validate this change?
.test.tsfiles).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist