Skip to content

feat(gh): set a release App key of its own in each repository #6769

Open

Description

@dan-petty

Problem

Owner direction of 2026-11-22: a devops command makes and sets the release App credentials of a repository, so that each repository has its own key. One release App serves the whole account ("one release app per org"); a key is not used again in a second repository.

  • dan-petty/infra and dan-petty/devtools release with release-please and a token of the release App dan-petty-release from the environment release (RELEASE_APP_CLIENT_ID, RELEASE_APP_PRIVATE_KEY). Their environments have the variable and the rule that only main deploys, but no key.
  • GitHub returns no secret value, and one key in many repositories means that a leak of one repository needs a new key in all of them.
  • An App can have more than one private key. GitHub has no API that makes one: a person makes a key on the settings page of the App, and the browser downloads it as <slug>.<date>.private-key.pem (GitHub docs, "Managing private keys for GitHub Apps"). GitHub shows the SHA-256 fingerprint of each key there.

Proposed remedy

A command that a person runs, for example devops gh app key --repo <owner>/<name> [--environment release] [--dry-run]. The App comes from the config (slug, App ID, client ID), not from a flag of each run.

  1. Opens the key page of the App and waits for a new .pem file of the App in the download folder (or takes --key-file).
  2. Proves that the key belongs to the App: a JWT signed with the key gets GET /app, and the slug is the App slug. It checks that the App is installed on the repository (GET /repos/<repo>/installation).
  3. Makes the environment, if missing, with the rule that only the default branch deploys. It sets the variable RELEASE_APP_CLIENT_ID, and seals the key with the public key of the environment (libsodium, as devops gh secret sync seals) into the secret RELEASE_APP_PRIVATE_KEY. It sets the variable RELEASE_APP_KEY_FINGERPRINT (not secret), so a person sees which key of the settings page belongs to the repository.
  4. Deletes the downloaded file after the upload. It never prints, logs or traces the key, and keeps no other copy.
  5. --dry-run sends no request and prints the plan.
    To rotate the key of one repository, the person runs the command again and deletes the old key, by its fingerprint, on the settings page.

Acceptance criteria

  • Tests with a fake GitHub (GET /app, the installation, the environment, its public key, the variables and the secret) show the requests in order, refuse a key of another App, and show no key in the output, the log or a trace attribute.
  • --dry-run makes no request, and the downloaded file is gone after a run that succeeds.
  • A person runs the command for dan-petty/infra and dan-petty/devtools with one new key each, and the Release job of each repository passes the credential check.

Person steps

  • The person runs the command and makes the key on the settings page of the App. Only a person makes keys and changes secrets.

Dependencies

None.

Activity

  1. added
    type/feature
    source/agent
    status/new
    value/medium
    effort/high
    scope/gh
    on Nov 22, 2026
  2. dan-petty commented on Nov 22, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 22, 2026
  4. changed the title [-]feat(gh): make and set the release App credentials of a repo[/-] [+]feat(gh): set a release App key of its own in each repository[/+] on Nov 22, 2026
  5. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 22, 2026
  6. dan-petty commented on Nov 22, 2026

    @dan-petty
    OwnerAuthor

    Deferred by the owner on 2026-11-22: "let's use the same release key for now and schedule the work for later". Until this item is built, dan-petty/infra and dan-petty/devtools use the key of the release App that dan-petty/devops-cli uses. When this command exists, run it for each of the 2 repositories, and then delete the reused key from their environments only by replacing it, as the command does.

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

    effort/highowner/agentpriority/p2-mediumscope/ghsource/agentstatus/in-progresstype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions