Skip to content

check-repo on the device: say which GitHub token to use, and keep it read-only #5

Done

Description

@vidalc2

With GH_RUNNER_REPOS set, gh-runners-ctl.sh start runs check-repo.sh on the device at every start. Without a gh login or GH_TOKEN there, the check answers UNVERIFIED and a runner that never passed on the device is refused (scripts/gh-runners-ctl.sh L60-L65). So in practice the operator logs in to GitHub on the device.

The docs do not say with what. A default gh auth login creates a classic OAuth token with the repo scope: write access to every repository the account can reach, stored in the Termux home. That goes against the README's read-only-token stance, on the one machine where CI jobs run under the same Android uid as everything else.

Suggested fix

  • In the README, AGENTS.md and mini-runner.env.example, name the narrowest token that works: a fine-grained token limited to the repositories in GH_RUNNER_REPOS, with read-only Administration, passed as GH_TOKEN from a chmod 600 file outside the rootfs.
  • Say plainly not to run a default gh auth login on the device.
  • Same for GitLab: a project access token with read_api rather than a personal glab login.

Activity

  1. agent-kit-startup commented on Nov 30, 2026

    @agent-kit-startup
    Contributor

    Thanks, @vidalc2. Documented in #18, released in v0.2.1: the README now has a "Device token for the start check" section that recommends a fine-grained token limited to the runner repositories, read-only, kept apart from the board's tokens.

    While writing it we also fixed #20 in the same release: runner-ctl.sh now exports GITLAB_HOST from the env file, and without glab, check-repo.sh sends GITLAB_TOKEN only to the host named in GITLAB_HOST (gitlab.com included). With a token and no GITLAB_HOST, a GitLab target is reported UNVERIFIED and no request is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions