René's URL Explorer Experiment


Title: Make `auth` in `GitHubApiDetails` optional by mbg · Pull Request #4230 · github/codeql-action · GitHub

Open Graph Title: Make `auth` in `GitHubApiDetails` optional by mbg · Pull Request #4230 · github/codeql-action

X Title: Make `auth` in `GitHubApiDetails` optional by mbg · Pull Request #4230 · github/codeql-action

Description: Related to #4198 (comment). We currently have a few different scenarios for where we fetch CodeQL CLI releases from depending on the environment that the CodeQL Action is running in. The usual case is that the running Action comes from github.com/github/codeql-action and is running in a workflow on github.com. In that case, the token we have can be used with api.github.com. The CodeQL Action may also be running on GHES or GitHub Enterprise Cloud with Data Residency. In those cases, the token we have is for the respective environment. Our logic for finding a release to download the CodeQL CLI from prioritises the more specific environments, but falls back to fetching a release from github.com/github/codeql-action if the release is not available more locally. In that case, we should not use the token to authenticate any requests made from the host instance to the GitHub.com instance. Currently, for downloads, this is done with the help of getAuthorizationHeaderFor which tests whether a given url matches the GitHub instance represented by a particular GitHubApiDetails object, which also contains the token. The token is only returned if the url is a match for the GitHub instance. We don't currently have an equivalent process for API requests from a different GitHub instance to GitHub.com, even though the GitHub.com API will accept unauthenticated requests for public resources (with much tighter rate limits than authenticated requests). This is, in part, because we use getOctokitOptions from @actions/github to construct OctokitOptions for the API client, which requires a (non-empty) token. This PR tidies up some of the code related to this, but mainly replaces the (virtually unnecessary) call to getOctokitOptions so that we are constructing the OctokitOptions ourselves and allow no token to be provided. This is fine for Octokit. This relaxation of the requirements in our api-client.ts library isn't used here, but it will allow us to make some API requests from other GitHub instances to GitHub.com in the future when necessary. 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. Third-party analyses - The changes affect the upload-sarif action. 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? 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.

Open Graph Description: Related to #4198 (comment). We currently have a few different scenarios for where we fetch CodeQL CLI releases from depending on the environment that the CodeQL Action is running in. The usual case...

X Description: Related to #4198 (comment). We currently have a few different scenarios for where we fetch CodeQL CLI releases from depending on the environment that the CodeQL Action is running in. The usual case...

Opengraph URL: https://github.com/github/codeql-action/pull/4230

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:339371c1-1ff5-94e7-deb2-4822fb37add3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE018:197704:67E2CD:86ACD1:6AED2D25
html-safe-nonce8c592786f8b418f6c6b210d68b0f79d21f3d6b1fcf55b3af90539552e2340362
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDE4OjE5NzcwNDo2N0UyQ0Q6ODZBQ0QxOjZBRUQyRDI1IiwidmlzaXRvcl9pZCI6Ijg2NTg4NjYzOTIyMzgyMDYyNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb4d6bbad5529e14ea99b9bfbff6dfd5a865e569d7910cfc2dbbcdf513430b650
hovercard-subject-tagpull_request:4845671364
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/codeql-action/pull/4230/files
twitter:imagehttps://avatars.githubusercontent.com/u/278086?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/278086?s=400&v=4
og:image:altRelated to #4198 (comment). We currently have a few different scenarios for where we fetch CodeQL CLI releases from depending on the environment that the CodeQL Action is running in. The usual case...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonee51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/codeql-action git https://github.com/github/codeql-action.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id259445878
octolytics-dimension-repository_nwogithub/codeql-action
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id259445878
octolytics-dimension-repository_network_root_nwogithub/codeql-action
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release59ebb7b901cc154ecc179a44f266fcf69f343b30
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql-action/pull/4230/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql-action%2Fpull%2F4230%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql-action%2Fpull%2F4230%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fcodeql-action
Reloadhttps://github.com/github/codeql-action/pull/4230/files
Reloadhttps://github.com/github/codeql-action/pull/4230/files
Reloadhttps://github.com/github/codeql-action/pull/4230/files
githubhttps://github.com/github
codeql-actionhttps://github.com/github/codeql-action
Codehttps://github.com/github/codeql-action
Issues165 (165)https://github.com/github/codeql-action/issues
Pull requests41 (41)https://github.com/github/codeql-action/pulls
Actionshttps://github.com/github/codeql-action/actions
Security and quality2 (2)https://github.com/github/codeql-action/security
Insightshttps://github.com/github/codeql-action/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fcodeql-action%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fcodeql-action%2Fissues%2Fnew%2Fchoose
mbghttps://github.com/mbg
mainhttps://github.com/github/codeql-action/tree/main
mbg/auth/allow-unauthedhttps://github.com/github/codeql-action/tree/mbg/auth/allow-unauthed
Conversation 8 https://github.com/github/codeql-action/pull/4230
Commits 15 https://github.com/github/codeql-action/pull/4230/commits
Checks 233 https://github.com/github/codeql-action/pull/4230/checks
Files changed https://github.com/github/codeql-action/pull/4230/files
Please reload this pagehttps://github.com/github/codeql-action/pull/4230/files
Make auth in GitHubApiDetails optional https://github.com/github/codeql-action/pull/4230/files#top
Show all changes 15 commits https://github.com/github/codeql-action/pull/4230/files
0735d79 Improve `GitHubApiDetails` types and documentation mbg Oct 13, 2026 https://github.com/github/codeql-action/pull/4230/commits/0735d7910f37690a85af436f06afded391ee600a
102e46e Move some definitions out of `util.ts` into a new `github.ts` module mbg Oct 13, 2026 https://github.com/github/codeql-action/pull/4230/commits/102e46e9d1abdb4871aac04e4ed3fec64c04e7aa
61bfcff Add functions to get the current and dotcom instance mbg Oct 13, 2026 https://github.com/github/codeql-action/pull/4230/commits/61bfcffab940433010be7ea4a590ab7b79af33fc
e062530 Move `GitHubApiDetails` to `github.ts` mbg Oct 13, 2026 https://github.com/github/codeql-action/pull/4230/commits/e0625309c3719bb247f65c530f610b0070b0b4c9
a243813 Make `auth` property on `GitHubApiDetails` optional mbg Oct 13, 2026 https://github.com/github/codeql-action/pull/4230/commits/a2438139ceded157f810d8253ce354b7ead36f56
96501a3 Use `getCurrentInstance()` mbg Oct 13, 2026 https://github.com/github/codeql-action/pull/4230/commits/96501a33aca65626acc8abecc8828308ea02e5d0
1b0a617 Make `externalRepoAuth` check more consistent mbg Oct 13, 2026 https://github.com/github/codeql-action/pull/4230/commits/1b0a6176418fa9e5a76c322d979238da25860f29
1d30a84 Guard against blank `auth` value mbg Oct 13, 2026 https://github.com/github/codeql-action/pull/4230/commits/1d30a842cdeeeefc0329cf66b8c22f08f1d1a99c
66c96fd Check `auth` value in `getAuthorizationHeaderFor` mbg Oct 14, 2026 https://github.com/github/codeql-action/pull/4230/commits/66c96fdc352a0a789e220cc8bf958e8a5fcb516c
f9b4185 Check token value in `uploadBundledDatabase` mbg Oct 14, 2026 https://github.com/github/codeql-action/pull/4230/commits/f9b4185b99e69102ca688508e7446a19f2c937be
bfe264b Add very basic `getApiClientWithExternalAuth` test mbg Oct 14, 2026 https://github.com/github/codeql-action/pull/4230/commits/bfe264b55993bd05f49bd7a65119f716425a1ffd
a08b587 Allow `getApiClient` to accept `GitHubApiDetails` mbg Oct 14, 2026 https://github.com/github/codeql-action/pull/4230/commits/a08b587b612ed1666540f2a8e91b768e58e452ec
f6e8dce Pass `apiDetails` to `getApiClient` in `uploadBundledDatabase` mbg Oct 14, 2026 https://github.com/github/codeql-action/pull/4230/commits/f6e8dce502d1ae775fbdbfce10c37cf05ae3074c
047c751 Add a test for `uploadBundledDatabase` mbg Oct 14, 2026 https://github.com/github/codeql-action/pull/4230/commits/047c751d925e1a08464af8184eb81d1a3ac034ac
c164184 Remove explicit `authorization` header from `uploadBundledDatabase` mbg Oct 14, 2026 https://github.com/github/codeql-action/pull/4230/commits/c1641847bb01dd388b3d0ef6a5dd7b4af7ea222c
Clear filters https://github.com/github/codeql-action/pull/4230/files
Please reload this pagehttps://github.com/github/codeql-action/pull/4230/files
Please reload this pagehttps://github.com/github/codeql-action/pull/4230/files
entry-points.js https://github.com/github/codeql-action/pull/4230/files#diff-73697317a7dd14441dcfb24bc586f637ae2b815b5e503a05a81816be74fcd815
api-client.test.ts https://github.com/github/codeql-action/pull/4230/files#diff-c885eacf675ef06f18293958b918f7b8d5faca26b60940bf17da595e6caabaae
api-client.ts https://github.com/github/codeql-action/pull/4230/files#diff-42ff9f1380ec4f23f68cf329edd327ab3298a662fc2df90bd01da76a69fecf59
codeql.test.ts https://github.com/github/codeql-action/pull/4230/files#diff-a59b656ff6cb8e9e4da88f2f927636ffc66ffadca08a86eb1024f9c2690d8ad9
database-upload.test.ts https://github.com/github/codeql-action/pull/4230/files#diff-3c670c636ce19ce0145d7d43352d13dc28a314f2b6264cab4be5f23def1c5edd
database-upload.ts https://github.com/github/codeql-action/pull/4230/files#diff-176a9575a8d49479380a7466f77508cb223b04dc5663a5ed55293f5ae72b234f
github.test.ts https://github.com/github/codeql-action/pull/4230/files#diff-9e6bc206cb12dbe3f71cb84cd7a38467b6b547dab6f1dc8eb77ffd870ec96124
github.ts https://github.com/github/codeql-action/pull/4230/files#diff-a248ff5ec76368168c745273fee0601b243545fdca37aa3bec76ef9e9365fdb7
init-action.ts https://github.com/github/codeql-action/pull/4230/files#diff-87bf9e0a2a9244ba1f26eb01d404deaccbc9580479d2e2530a4ff2fd5bd91565
setup-codeql-action.ts https://github.com/github/codeql-action/pull/4230/files#diff-03d2b2bd0e1c4d4ed0fd6ddac8033710b48fb01370983c27b17b3cab5ea0a8ba
repository.ts https://github.com/github/codeql-action/pull/4230/files#diff-d9c356bf9bc3383b86a1958e005a46287c1bfb0b0d9d8e220f705c51455d351e
status-report.ts https://github.com/github/codeql-action/pull/4230/files#diff-3abb83ffc5df1d349d32759ed4876c4c1a50b63d3187ec177d67cb76f0bd50e7
upload-lib.ts https://github.com/github/codeql-action/pull/4230/files#diff-9c600636c759380cf603b7cb23771d1fe5b3cf73df63a71bd566c0cf34fa6b38
util.test.ts https://github.com/github/codeql-action/pull/4230/files#diff-5b8db3845646ec2fda6f1a8fb2b5b8c67460b5070568f4be6320f344704969cd
util.ts https://github.com/github/codeql-action/pull/4230/files#diff-3294a832ea2276e554177e0b3007cc2d401c082912c7fbde49fa09141bf1aed1
https://github.com/github/codeql-action/blob/main/CODEOWNERS#L1
lib/entry-points.jshttps://github.com/github/codeql-action/pull/4230/files#diff-73697317a7dd14441dcfb24bc586f637ae2b815b5e503a05a81816be74fcd815
View file https://github.com/github/codeql-action/blob/c1641847bb01dd388b3d0ef6a5dd7b4af7ea222c/lib/entry-points.js
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/github/codeql-action/pull/4230/files
https://github.com/github/codeql-action/blob/main/CODEOWNERS#L1
src/api-client.test.tshttps://github.com/github/codeql-action/pull/4230/files#diff-c885eacf675ef06f18293958b918f7b8d5faca26b60940bf17da595e6caabaae
View file https://github.com/github/codeql-action/blob/c1641847bb01dd388b3d0ef6a5dd7b4af7ea222c/src/api-client.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-action/pull/4230/{{ revealButtonHref }}
https://github.com/github/codeql-action/pull/4230/files#diff-c885eacf675ef06f18293958b918f7b8d5faca26b60940bf17da595e6caabaae
https://github.com/github/codeql-action/pull/4230/files#diff-c885eacf675ef06f18293958b918f7b8d5faca26b60940bf17da595e6caabaae
https://github.com/github/codeql-action/pull/4230/files#diff-c885eacf675ef06f18293958b918f7b8d5faca26b60940bf17da595e6caabaae
Please reload this pagehttps://github.com/github/codeql-action/pull/4230/files
Please reload this pagehttps://github.com/github/codeql-action/pull/4230/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.