Title: `setup-python` pip upgrade triggers root user warning on self-hosted runners · Issue #1295 · actions/setup-python · GitHub
Open Graph Title: `setup-python` pip upgrade triggers root user warning on self-hosted runners · Issue #1295 · actions/setup-python
X Title: `setup-python` pip upgrade triggers root user warning on self-hosted runners · Issue #1295 · actions/setup-python
Description: Problem On root-user self-hosted runners (e.g. Hetzner Cloud), setup-python internally upgrades pip against the system Python outside any venv: // src/find-python.ts — installPip() `${pythonLocation}/python -m pip install --upgrade pip -...
Open Graph Description: Problem On root-user self-hosted runners (e.g. Hetzner Cloud), setup-python internally upgrades pip against the system Python outside any venv: // src/find-python.ts — installPip() `${pythonLocatio...
X Description: Problem On root-user self-hosted runners (e.g. Hetzner Cloud), setup-python internally upgrades pip against the system Python outside any venv: // src/find-python.ts — installPip() `${pythonLocatio...
Opengraph URL: https://github.com/actions/setup-python/issues/1295
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`setup-python` pip upgrade triggers root user warning on self-hosted runners","articleBody":"## Problem\n\nOn root-user self-hosted runners (e.g. Hetzner Cloud), `setup-python` internally upgrades pip against the **system Python** outside any venv:\n\n```typescript\n// src/find-python.ts — installPip()\n`${pythonLocation}/python -m pip install --upgrade pip --disable-pip-version-check`\n```\n\nThis produces on every run:\n\n```\nWARNING: Running pip as the 'root' user can result in broken permissions...\nUse the --root-user-action option if you know what you are doing.\n```\n\nThe warning **cannot be suppressed** from the workflow side because `setup-python` spawns the pip subprocess via a Node.js child process with a controlled environment that does not reliably inherit the job-level `PIP_ROOT_USER_ACTION` env var or `/etc/pip.conf`.\n\n## Proposed Fix\n\nAdd `--root-user-action=ignore` to the pip upgrade call in `src/find-python.ts`:\n\n```typescript\nawait exec.exec(`${pythonLocation}/python`, [\n '-m', 'pip', 'install', '--upgrade', 'pip',\n '--root-user-action=ignore',\n '--disable-pip-version-check',\n '--no-warn-script-location'\n]);\n```\n\nThis is a **non-breaking, no-op change** on non-root runners.\n\n## Reproduction\n\n```yaml\njobs:\n test:\n runs-on: self-hosted # root user (e.g. Hetzner Cloud ephemeral runner)\n steps:\n - uses: actions/setup-python@v6\n with:\n python-version: '3.12'\n```\n\n**Log output:**\n```\nUpgrading pip...\nWARNING: Running pip as the 'root' user...\nSuccessfully installed pip-26.0.1\n```\n\n## Environment\n\n| | |\n|---|---|\n| `setup-python` | `v6` |\n| Runner OS | Ubuntu 24.04 |\n| Runner user | `root` |\n| Python version | `3.12` |\n\n","author":{"url":"https://github.com/xgboosted","@type":"Person","name":"xgboosted"},"datePublished":"2026-03-21T13:19:14Z","url":"https://github.com/actions/setup-python/issues/1295"}
| react-profiling | 0 |
| react-import-map | react,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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:345a61a3-3e16-2ab8-fa2b-3156029865e4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8540:383F61:83C947:AF1D71:6AF847CF |
| html-safe-nonce | 67be8acc344169aa656d8b899dd94d7b1434b355d5527eacf84b29a3653b11e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTQwOjM4M0Y2MTo4M0M5NDc6QUYxRDcxOjZBRjg0N0NGIiwidmlzaXRvcl9pZCI6IjE1OTE2ODU3MzE3NDkyMTgyNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | eb0d79b26a7dce393eb63317a93254b3bbc41d4974f3a7eb3b71373931784ad7 |
| hovercard-subject-tag | issue:4112515127 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/setup-python/1295/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d7dd84ff17aced2d3071d9863fcae0dba9f7a6dc31334b1b0c83a44627e6bd9e/actions/setup-python/issues/1295 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d7dd84ff17aced2d3071d9863fcae0dba9f7a6dc31334b1b0c83a44627e6bd9e/actions/setup-python/issues/1295 |
| og:image:alt | Problem On root-user self-hosted runners (e.g. Hetzner Cloud), setup-python internally upgrades pip against the system Python outside any venv: // src/find-python.ts — installPip() `${pythonLocatio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xgboosted |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/setup-python git https://github.com/actions/setup-python.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 192625525 |
| octolytics-dimension-repository_nwo | actions/setup-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 192625525 |
| octolytics-dimension-repository_network_root_nwo | actions/setup-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 653be32ff5c755082a4db662491bfbbcfc9112c1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width