Orkestia
Blog
Registry

Log in from GitHub Actions

One step logs a GitHub Actions job into Orkestia Registry for Docker, pip, uv, twine and npm, with no secret stored in GitHub, and rules decide which jobs may push.

A GitHub Actions job logs in to your namespace with no secret or API key stored in GitHub. The job proves who it is with the identity token GitHub issues to it. Orkestia checks that token against your organization's GitHub App installation and its CI access rules, and returns a registry token for your namespace, valid for one hour.

The repository must belong to the GitHub organization connected to your Orkestia organization.

Add the step

Give the job permissions: id-token: write and add one step, orkestia/registry-login@v1:

permissions:
  id-token: write   # lets GitHub issue the job's identity token
  contents: read

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: orkestia/registry-login@v1
        id: orkestia
      - run: |
          docker build -t ${{ steps.orkestia.outputs.registry }}/api:${{ github.sha }} .
          docker push ${{ steps.orkestia.outputs.registry }}/api:${{ github.sha }}

It works the same on GitHub-hosted runners, on your own runners, and on Orkestia runners.

What the step sets up

ToolAfter the step
Docker, buildxdocker login registry.orkestia.dev is done, with your namespace as the username
pip, uvRequests to packages.orkestia.dev are authenticated for this job. Point them at your index: pip install --extra-index-url "${{ steps.orkestia.outputs.pip-index-url }}" my-package
twine, uv publishUse the outputs: twine upload --repository-url "${{ steps.orkestia.outputs.pip-upload-url }}" -u "$ORKESTIA_NAMESPACE" -p "$ORKESTIA_TOKEN" dist/*
npmPackages in the @<namespace> scope resolve from and publish to your namespace. Other packages still come from the public registry

The token is also exported to later steps as ORKESTIA_TOKEN, with the username in ORKESTIA_NAMESPACE. Nothing is written to the home directory except the Docker login. The pip and npm settings live in the job's temporary directory, which the runner empties after the job.

How it works for each tool:

  • pip and uv read a netrc file the step writes for packages.orkestia.dev, and the step points NETRC at it. Entries you already had in ~/.netrc for other hosts are kept.
  • npm reads the user .npmrc that NPM_CONFIG_USERCONFIG names. The step adds two lines to it, @<namespace>:registry=https://packages.orkestia.dev/<namespace>/npm/ and //packages.orkestia.dev/<namespace>/npm/:_authToken=${ORKESTIA_TOKEN}, so the token itself is never written to the file. If actions/setup-node already created a user .npmrc, the step adds to that one. Run actions/setup-node before the login step. If it runs after the login step with registry-url, it points npm at a new file without these lines.
  • Docker is logged in with docker login, so buildx and docker/build-push-action use it too.

A CI token can pull, or pull and push. It cannot delete: delete images with a one-hour password.

Inputs

InputDefault
scopeemptypull, push, or empty for the widest access the job is allowed
dockertrueRun docker login when Docker is installed
pythontrueAuthenticate pip and uv to the package index for this job
npmtrueMap the @<namespace> scope to your npm registry for this job
exchange-urlOrkestia'sLeave the default

A job that only reads can ask for less:

      - uses: orkestia/registry-login@v1
        with:
          scope: pull

scope: push makes the step fail when the job may only pull, instead of failing later at the push.

Outputs

OutputExample
namespaceacme
scopepush
registryregistry.orkestia.dev/acme
pip-index-urlhttps://packages.orkestia.dev/acme/simple/
pip-upload-urlhttps://packages.orkestia.dev/acme/
npm-registryhttps://packages.orkestia.dev/acme/npm/

Jobs longer than an hour

The token is valid for one hour. Run the step again before a push that starts later than that. The action's README also describes a Docker credential helper that fetches a fresh token whenever Docker needs one.

On Orkestia runners

Jobs on Orkestia runners reach registry.orkestia.dev and packages.orkestia.dev over a private network path, automatically. There is nothing to configure and the hostnames are the same. Usage shows that traffic as the private network path.

Who can push

Until an organization admin sets rules of their own, these defaults apply:

Every repository of the organization's GitHub installation may pull. Push only from a tag, a GitHub environment, or the repository's default branch, on push, release, workflow_dispatch, schedule or merge_group events. Pull requests only pull.

A pull request from a fork never gets a token: GitHub does not issue one to it.

Your own rules

Organization owners and admins manage the rules in Cockpit, in the CI trust rules section of Registry → Images, or with these workflows. Members can read them:

WorkflowWhoWhat it does
identity.federation.trust-listThe organizationLists the rules, or says the defaults apply and what they are
identity.federation.trust-setAdminAdds a rule, or replaces the rule with the same name
identity.federation.trust-removeAdminRemoves a rule by name

A rule has these fields:

FieldMeaning
nameUnique in the organization: 1 to 64 lowercase letters, digits and hyphens
accesspull or push (push also pulls)
repositoriesOptional. GitHub's numeric repository ids, not names, so renaming a repository cannot take over a rule. Omitted: every repository of the installation
refsOptional. Ref globs, for example refs/heads/main or refs/tags/v*. Omitted: any ref
environmentsOptional. GitHub environment names. Omitted: with or without an environment
eventsOptional. GitHub event names, for example push, release, workflow_dispatch. A push rule with no events gets push, release, workflow_dispatch, schedule and merge_group
workflowsOptional. job_workflow_ref globs, for example my-org/repo/.github/workflows/release.yml@refs/heads/main

How the rules apply:

  • Setting the first rule replaces the defaults. Removing the last rule brings the defaults back.
  • A job gets the widest access among the rules it matches. A job that matches no rule is refused.
  • A pull request never pushes, whatever a rule says. A push rule cannot name pull request events.
  • trust-set returns a warning when a push rule is broad, for example any branch, or events that people outside your organization can trigger.

For example, push only from version tags of one repository:

identity.federation.trust-set
  name          release-tags
  access        push
  repositories  [123456789]
  refs          ["refs/tags/v*"]

Remember that this first rule replaces the defaults, so add a pull rule as well if your other repositories still need to pull.

If the login is refused

The step prints orkestia: login refused (<error>: <reason>) and fails. The most common ones:

PrintedFix
this job cannot request a GitHub identity tokenAdd permissions: id-token: write to the workflow or the job. A pull request from a fork always gets this, because GitHub never issues it a token
invalid_grant: no organization is federated for this repository ownerThe repository's GitHub organization is not the one connected to your Orkestia organization
invalid_target: the organization has no active registryTurn the registry on, or on again
access_denied: no trust rule admits this jobYour organization has its own rules and none matches this job
invalid_scope: this job may pull, not pushThe step asked for scope: push but the job may only pull, for example in a pull request
limit_exceeded: ...A limit was reached. The text names it

Every message, with what Docker, pip, twine and npm print after a refused login, is on Troubleshooting.

When a limit has paused pushes, a job that leaves scope empty gets pull instead of failing, and only its push fails later. Set scope: push on publishing jobs to fail at the login, with the limit named.

Next

  • CI recipes: complete workflows for images, Python packages and npm packages.
  • Build cache: reuse layers between runs.