GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support shorthand forms for `getRemoteConfig` by mbg · Pull Request #3973 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Jun 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This is a follow-up to #3963 which modifies getRemoteConfig to accept shorthand addresses for remote files. Concretely, this adds a new format (gated behind a FF) where the owner, path, and ref components are optional and default to the owner of the current repo (as given by GITHUB_REPOSITORY), .github/codeql-action.yaml, and main respectively.

Examples:

  • owner/repo resolves to owner/repo@main:.github/codeql-action.yaml
  • owner/repo@dev resolves to owner/repo@dev:.github/codeql-action.yaml
  • owner/repo:.github/codeql/config.yml resolves to owner/repo@main:.github/codeql/config.yml

Notes for reviewers

  • We should discuss whether there's a better default we want for the path component
  • The default ref of main may not always be the default branch for the target repo, but that's OK since it can be manually set to a different ref if needed.
  • I originally implemented the shorthand forms from my proposal, but then noticed that getRemoteConfig already had a similar (but not equivalent) shorthand format. I then updated that instead so that the components other than the repo are optional. However, this isn't as nice, because / is used as a separator and can also appear in the path component. That means e.g. it is not possible with this format to specify a repo + path since it would be interpreted as owner + repo by the regex instead.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Workflow types:

  • Advanced setup - Impacts users who have custom CodeQL workflows.
  • Managed - Impacts users with dynamic workflows (Default Setup, Code Quality, ...).

Products:

  • Code Scanning - The changes impact analyses when analysis-kinds: code-scanning.
  • Code Quality - The changes impact analyses when analysis-kinds: code-quality.
  • Other first-party - The changes impact other first-party analyses.

Environments:

  • Dotcom - Impacts CodeQL workflows on github.com and/or GitHub Enterprise Cloud with Data Residency.
  • GHES - Impacts CodeQL workflows on GitHub Enterprise Server.

How did/will you validate this change?

  • Test repository - This change will be tested on a test repository before merging.
  • Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files).
  • End-to-end tests - I am depending on PR checks (i.e. tests in pr-checks).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix.

How will you know if something goes wrong after this change is released?

  • Telemetry - I rely on existing telemetry or have made changes to the telemetry.
    • Dashboards - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release.
    • Alerts - New or existing monitors will trip if something goes wrong with this change.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mbg added 10 commits June 23, 2026 16:16
@mbg
Add ActionsEnvVars enum
c05a5b7
@mbg
Allow abstracting over process.env
652296e
@mbg
Add RemoteFileAddress type
9c4ee01
@mbg
Move getRemoteConfig to config/file.ts
07b6b1e
@mbg
Refactor parseRemoteFileAddress out of getRemoteConfig
9ef8be7
@mbg
Return RemoteFileAddress from parseRemoteFileAddress
82e5ca6
@mbg
Add getRemoteConfig JSDoc
c7a94c9
@mbg
Add tests for parseRemoteFileAddress
85c8a8c
@mbg
Make ref optional in parseRemoteFileAddress
598d008
@mbg
Make path optional in parseRemoteFileAddress
e537ff2
@mbg
mbg requested a review from mario-campos June 23, 2026 17:03
@mbg mbg self-assigned this Jun 23, 2026
@github-actions github-actions Bot added the size/L May be hard to review label Jun 23, 2026
@mbg
Make owner optional in parseRemoteFileAddress
12821cf
@mbg
mbg force-pushed the mbg/repo-props/config-file-shorthands branch from a2218f1 to 12821cf Compare June 23, 2026 17:13
@mbg
mbg marked this pull request as ready for review June 23, 2026 17:15
@mbg
mbg requested a review from a team as a code owner June 23, 2026 17:15
Copilot AI review requested due to automatic review settings June 23, 2026 17:15
Copilot started reviewing on behalf of mbg June 23, 2026 17:16
View session
Copilot AI reviewed Jun 23, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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 extends remote configuration file support by enhancing getRemoteConfig to accept shorthand remote addresses (optional owner, path, and ref with sensible defaults), and refactors environment access to be more testable via an Env wrapper.

Changes:

  • Added parseRemoteFileAddress (and tests) to parse shorthand remote config references with defaults for owner/path/ref.
  • Moved getRemoteConfig into src/config/file.ts and updated callers to use the new parsing logic.
  • Introduced ActionsEnvVars and an Env abstraction to reduce raw string usage and improve testability.
Show a summary per file
File Description
src/util.ts Adds Env accessor helpers and refactors env var getters.
src/testing-utils.ts Adds getTestEnv() and tightens typing for default Actions env vars.
src/environment.ts Introduces Env interface abstraction for environment access.
src/config/remote-file.ts New parser for shorthand remote config references and defaults.
src/config/remote-file.test.ts Unit tests for remote file address parsing and defaults.
src/config/file.ts Adds getRemoteConfig() using parsed remote address components.
src/config-utils.ts Switches to the new getRemoteConfig() implementation.
src/config-utils.test.ts Removes a test that no longer matches the supported shorthand syntax.
src/api-client.ts Replaces raw env var names with ActionsEnvVars.
src/actions-util.ts Adds ActionsEnvVars enum and updates env var usages.
lib/entry-points.js Changed but excluded from review (generated/contents unavailable).

Copilot's findings

Files excluded by content exclusion policy (1)
  • lib/entry-points.js
  • Files reviewed: 10/11 changed files
  • Comments generated: 6

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/util.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mbg added 6 commits June 23, 2026 18:31
@mbg
Fix test names
81ad479
@mbg
Anchor regex and trim input
8102fa6
@mbg
Update format in error message
00e5a58
@mbg
Improve whitespace handling
8d69da9
@mbg
Fix getEnv not using getOptionalEnvVarFrom
3fe7ef9
@mbg
Merge remote-tracking branch 'origin/main' into mbg/repo-props/config…
812b882
…-file-shorthands
mario-campos
mario-campos previously approved these changes Jun 24, 2026
View reviewed changes

@mario-campos mario-campos left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks solid! I left a few comments, but minor stuff.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.test.ts Outdated
ref: DEFAULT_CONFIG_FILE_REF,
} satisfies RemoteFileAddress);

t.deepEqual(parseRemoteFileAddress(env, "owner/repo/path@"), {

@mario-campos mario-campos Jun 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think this should be invalid, for the same reason that /repo@ref is invalid.

Edit: Also, I just noticed the expected format below does not seem to indicate that this should be a correct format:

Expected format [<owner>/]<repository>[/<file-path>][@<ref>]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Jun 25, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I have no strong feelings on this, but agree that we should be consistent. I can change this to also be invalid.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/config/file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mbg added 3 commits June 26, 2026 18:09
@mbg
Support old and new formats
f77cf55
@mbg
Add FF for shorthands
d8d1d6d
@mbg
Add initial ActionState type
e446d55
mbg added 2 commits June 30, 2026 13:19
@mbg
Add TestEnv class to simplify testing of ActionState-dependent fu…
7b2af89
…nctions
@mbg
Gate new remote file format behind FF
b6be81d
@mbg
mbg dismissed mario-campos’s stale review via b6be81d June 30, 2026 12:20
@github-actions github-actions Bot added size/XL May be very hard to review and removed size/L May be hard to review labels Jun 30, 2026
@mbg
mbg requested a review from mario-campos June 30, 2026 12:35
mario-campos
mario-campos requested changes Jun 30, 2026
View reviewed changes

@mario-campos mario-campos left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I left a few comments, most of them minor/simple.

If you're wondering about the Outdated label on the comments... I commented on the individual commits, because I reviewed them chronologically.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/config/remote-file.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/action-common.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.test.ts
{ input: "owner/repo @ref:path", expected },
{ input: "owner/repo@ ref:path", expected },
{ input: "owner/repo@ref :path", expected },
{ input: "owner/repo@ref: path", expected },

@mario-campos mario-campos Jun 30, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Whitespace is significant in a file path. How do you know that path is a typo, and that the user—for whatever reason—didn't actually intend path?

But, taking a step back, I don't think we should necessarily support (or expect) whitespace in the address. I think it's perfectly acceptable to treat a typo/mistake as an error, if it is, in fact, a mistake. That would allow us to treat owner , repo, ref literally and simplify the logic a bit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Jun 30, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Whitespace is significant in a file path.

The path is used in getRemoteConfig as argument to the path parameter for the rest.repos.getContent call. I am not sure that leading or trailing whitespace would be meaningful there, or how happy git/GitHub is with repos containing whitespace at the start / end of file paths. If that is supported, then it would of course make sense to keep it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mario-campos mario-campos Jun 30, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I am not sure that leading or trailing whitespace would be meaningful there, or how happy git/GitHub is with repos containing whitespace at the start / end of file paths.

I would expect git/GitHub to do its own input validation. And error appropriately if whitespace is invalid.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/config/remote-file.ts
const pieces = OLD_REMOTE_ADDRESS_FORMAT.exec(input);

// 5 = 4 groups + the whole expression
if (pieces?.groups === undefined || pieces.length < 5) {

@mario-campos mario-campos Jun 30, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

pieces.length < 5 is a useless condition, because it will always be false. The regular expression pattern will either match with 4 groups + the whole expression, or it will not match at all.

In fact, pieces.length will also never be greater than 5.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Jun 30, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This is a check kept from the previous implementation and not new in this PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.ts
* All the components are required. Unchanged from the previous implementation.
*/
const OLD_REMOTE_ADDRESS_FORMAT = new RegExp(
"(?<owner>[^/]+)/(?<repo>[^/]+)/(?<path>[^@]+)@(?<ref>.*)",

@mario-campos mario-campos Jun 30, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

  1. Since all components are required, the ref group should have the + quantifier. The * quantifier can consume zero characters, which can mean that the ref group is the empty string, which would need to be handled in a special case.
  2. This pattern should be anchored to match the whole string.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Jun 30, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What you wrote mirrors what Copilot complained about originally when I updated the regex to make parts of it optional. However, now that I have added a new regex for the new format, OLD_REMOTE_ADDRESS_FORMAT is just the regex from the existing code before any changes in this PR. In other words, making these adjustments (while perhaps reasonable) would alter the original behaviour. The old behaviour is not FF-gated, and so we'd be making a breaking change to existing code. That seems unnecessary to me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
Index ActionState over the types of state used
708e106
This was referenced Jul 1, 2026
Add FF for configuration file repository property #3983
Merged
Add ActionState type and make some initial use of it #3990
Merged
Allow abstracting over process.env #3993
Merged
mbg added 5 commits July 6, 2026 15:14
@mbg
Refactor Config type out of config-utils
5094019
@mbg
Refactor pack registry code out of config-utils
73f4741
@mbg
Mark some status-report imports as type-only to avoid circular de…
69c9e8c
…pendencies
@mbg
Thread ActionState to initConfig
8e22350
@mbg
Merge remote-tracking branch 'origin/main' into mbg/repo-props/config…
7dc37cb
…-file-shorthands
@mbg
mbg requested a review from Copilot July 6, 2026 14:58
Copilot started reviewing on behalf of mbg July 6, 2026 14:59
View session
Copilot AI reviewed Jul 6, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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.

Review details

Files excluded by content exclusion policy (1)
  • lib/entry-points.js
  • Files reviewed: 13/14 changed files
  • Comments generated: 3
  • Review effort level: Low

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/config/remote-file.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

mario-campos
mario-campos approved these changes Jul 7, 2026
View reviewed changes
@mbg
mbg added this pull request to the merge queue Jul 7, 2026
Merged via the queue into main with commit f58f0d1 Jul 7, 2026
230 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg deleted the mbg/repo-props/config-file-shorthands branch July 7, 2026 17:10
@github-actions github-actions Bot mentioned this pull request Jul 8, 2026
Merge main into releases/v4 #3996
Merged
5 of 8 tasks
mbg added a commit that referenced this pull request Jul 8, 2026
@mbg
Add changenote for #3973
31c2707
@github-actions github-actions Bot mentioned this pull request Jul 8, 2026
Merge releases/v4 into releases/v3 #3998
Merged
10 tasks done
@mbg mbg mentioned this pull request Jul 14, 2026
Fix new remote address being handled as local file by loadUserConfig #4012
Closed
This was referenced Sep 16, 2026
ci(actions): bump github/codeql-action/autobuild from 4.37.8 to 4.38.0 VBCreators/AI-RAG#35
Open
Upgrade CodeQL actions from v3.38.0 to v4.38.0 shmindmaster/heatlot#4
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@mario-campos mario-campos mario-campos approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mbg mbg

Labels

size/XL May be very hard to review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mbg @mario-campos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.