Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.

Sync environments with the current API spec: read-only build token - #304

Merged
joetannenbaum merged 1 commit into
mainfrom
api-sync/environments
Nov 24, 2026
Merged

joetannenbaum merged 1 commit into
mainfrom
api-sync/environments

Conversation

@joetannenbaum

@joetannenbaum joetannenbaum commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

The Cloud API spec changed. Environments can now clone their repository with a read-only token during builds.

Findings fixed

Where What the spec says What the CLI did
UpdateEnvironmentRequest.uses_read_only_build_token New. boolean: "Whether builds clone the repository with a read-only token. Builds can still read other repositories in the same GitHub account or organization. Only available for GitHub repositories. Applies on the next deployment." Never sent. environment:update now takes --uses-read-only-build-token and offers "Read-only build token" in the field picker, after "Deploy hook".
EnvironmentResource.attributes.uses_read_only_build_token New and required. boolean. Not on the DTO. Environment now has usesReadOnlyBuildToken, so --json and --fields return it and environment:update shows it as the previous value.

For review

  • No local GitHub check. The spec says only GitHub repositories support it. The CLI leaves that to the API rather than guessing the provider.
  • The two interactive basic-auth tests move from 14 to 15 down-presses, since the new option sits above that one in the picker.

Left alone

Branch note

api-sync/environments held only #303's pre-squash commits, whose tree matches main. I restarted the branch from main.

Tests

  • New feature tests: the flag sends uses_read_only_build_token, environment:get --fields=usesReadOnlyBuildToken returns it, and the interactive picker sends false when the confirm is declined.
  • Run under PHP 8.4 with a dummy LARAVEL_CLOUD_TOKEN: 846 pass. RepoConfigTest ran separately without the token: 14/14 pass. PromptFallbackTest was skipped because it hangs in this container. PHPStan and Pint are clean.

Demo

cloud environment:update

environment:update lists "Read-only build token" in the field picker and asks whether to turn it on.


Generated by Claude Code

The API now reports uses_read_only_build_token on an environment and
accepts it on update. The Environment DTO exposes it, so --json and
--fields can return it, and environment:update takes
--uses-read-only-build-token and offers it in the field picker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4VgnsPT8SHCykH1gmJ
@joetannenbaum
joetannenbaum merged commit 2c5bd59 into main Nov 24, 2026
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants