---
myst:
  html_meta:
    "description": "The environment variables repoplone reads, and the external commands it runs."
    "property=og:description": "The environment variables repoplone reads, and the external commands it runs."
    "property=og:title": "Environment variables and external tools"
    "keywords": "Plone, repoplone, environment variables, GITHUB_TOKEN, UV_PUBLISH_TOKEN, uv, npm, towncrier"
---

(reference-environment-variables)=

# Environment variables and external tools

This page lists the environment variables repoplone reads, and the commands it runs.

(reference-environment-variables-vars)=

## Environment variables

<!-- source: src/repoplone/utils/_github.py, get_token; src/repoplone/integrations/uv.py -->

repoplone reads two environment variables.

| Variable | Used by | Purpose |
|---|---|---|
| `GITHUB_TOKEN` | `release` | Checks that the token can read the repository's releases, then creates the GitHub release. |
| `UV_PUBLISH_TOKEN` | `release` | Counts as PyPI authentication in the checks before the release. `uv publish` uses it to upload. |

Without `GITHUB_TOKEN`, in an interactive terminal, repoplone offers to use the token of the GitHub CLI.

(reference-environment-variables-tools)=

## External commands

<!-- source: src/repoplone/integrations/ -->

repoplone runs these commands.
Each must be on the `PATH` for the commands that need it.

| Command | Run by | Purpose |
|---|---|---|
| `uv auth token pypi.org` | `release` | Checks PyPI authentication when `UV_PUBLISH_TOKEN` is not set. |
| `uv build`, `uv publish` | `release` | Builds and uploads Python packages. |
| `npm whoami` | `release` | Checks npm authentication. |
| `npx release-it` | `release` | Releases Node packages with `publish = true`. |
| `uvx towncrier` | `release`, `changelog preview` | Builds changelogs. Requires towncrier 25.8.0 or later. |
| `gh auth token` | `release` | Reads a GitHub token, after a confirmation. |
| `make <component>-install` | `deps upgrade`, `deps sync` | Installs a component and updates its lockfile. |

repoplone also uses git, through GitPython, and hatch, to read and set the version of Python packages.

(reference-environment-variables-network)=

## Network access

<!-- source: src/repoplone/utils/_requests.py, src/repoplone/utils/dependencies/distributions.py -->

These commands read from the network, with a timeout of 5 seconds per request.

| Endpoint | Read by |
|---|---|
| `https://pypi.org/pypi/<package>/json` | `deps check`, `deps upgrade`, `release` |
| `https://registry.npmjs.org/<package>` | `deps check`, `deps upgrade`, `release` |
| `https://dist.plone.org/release/<version>/constraints.txt` | `deps upgrade` and `deps constraints` for Plone |
| `https://raw.githubusercontent.com/<org>/<repository>/refs/tags/<version>/backend/pyproject.toml` | `deps upgrade` and `deps constraints` for kitconcept and PortalBrasil distributions |
| `https://api.github.com/repos/<owner>/<repository>/releases` | `release` |

```{seealso}
- {doc}`/how-to/authenticate`, to set up the tokens.
```
