Skip to content

feat: differentiate GitHub Actions environments in user-agent - #9517

Merged
reggi merged 2 commits into
latestfrom
reggi/ci-user-agent-github-actions
Jun 10, 2026
Merged

feat: differentiate GitHub Actions environments in user-agent#9517
reggi merged 2 commits into
latestfrom
reggi/ci-user-agent-github-actions

Conversation

@reggi

@reggireggi commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Updates the user-agent to specify github-actions runner.

When running in GitHub Actions, derive a more specific ci/ user-agent
token from GITHUB_SERVER_URL and RUNNER_ENVIRONMENT so dotcom-hosted,
dotcom-selfhosted, dotcom, ghe.com, and GHES runners can be told apart.
Env vars are normalized to guard against absent/empty/whitespace values,
and an empty server URL keeps the existing generic ci/github-actions token.
Closesgithub/npm#15170
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@reggi
reggi requested review from a team as code ownersJune 9, 2026 15:08
@reggireggi changed the title feat(config): differentiate GitHub Actions environments in user-agentfeat: differentiate GitHub Actions environments in user-agentJun 9, 2026
owlstronaut
owlstronaut previously approved these changes Jun 9, 2026
Comment threadworkspaces/config/lib/definitions/definitions.js Outdated
Comment threadworkspaces/config/test/definitions/definitions.js Outdated
Comment threadworkspaces/config/lib/definitions/definitions.js Outdated
Comment threadworkspaces/config/lib/definitions/definitions.js Outdated
…name}
Keep the base ci/{ci-name} token and append a generic sub-category as
ci/{ci-name}/{sub-ci-name} when one is detected. Under GitHub Actions the
sub-category is derived from GITHUB_SERVER_URL (parsed via the URL
constructor so only the hostname is matched) and RUNNER_ENVIRONMENT:
dotcom-hosted, dotcom-selfhosted, dotcom, ghecom, or ghes. Env vars are
normalized to guard against absent/empty/whitespace values, and an
empty/unparseable server url keeps the plain ci/{ci-name} token.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@reggi
reggi merged commit f6a9aad into latestJun 10, 2026
16 checks passed
@reggi
reggi deleted the reggi/ci-user-agent-github-actions branch June 10, 2026 15:18
@github-actionsgithub-actionsBot mentioned this pull request Jun 10, 2026
owlstronaut pushed a commit that referenced this pull request Jun 11, 2026
Updates the `user-agent` to specify github-actions runner.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot mentioned this pull request Jun 11, 2026
Sign up for freeto 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.

3 participants

@reggi@owlstronaut@nishantms