-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Describe the bug
When creating a Codespace with a devcontainer that requires additional permissions, an error will occur and the user is redirected to a link to allow the new permissions.
gh cs create --repo monalisa/octocat --branch main --devcontainer-path=.devcontainer/actions/devcontainer.json | tail -n 1
You must authorize or deny additional permissions requested by this codespace before continuing.
Open this URL in your browser to review and authorize additional permissions: github.com/monalisa/octocat/codespaces/allow_permissions
Alternatively, you can run "create" with the "--default-permissions" option to continue without authorizing additional permissions.This URL doesn't include any information about the devcontainer requested, so it will only allow you authorize permission for the default devcointainer.
This is only an issue when running gh cs create in a non-interactive way. When run directly, the user is prompted for options and the auth URL used is correct:
gh cs create --repo monalisa/octocat --branch main --devcontainer-path=.devcontainer/actions/devcontainer.json
You must authorize or deny additional permissions requested by this codespace before continuing.
? What would you like to do? [Use arrows to move, type to filter]
> Continue in browser to review and authorize additional permissions (Recommended)
Continue without authorizing additional permissionsCorrect auth URL: https://github.com/monalisa/octocat/codespaces/allow_permissions?ref=main&devcontainer_path=.devcontainer/actions/devcontainer.json
Steps to reproduce the behavior
- Set up a custom devcontainer in a separate directory with permissions to repositories that you haven't already authorized
- Run
gh cs createand specifiy the--devcontainer-path, piping the output to another command so that it isn't interactive - Observe that auth URL output does not have any query parameters and won't allow you to authorize with the separate devcontainer
Expected vs actual behavior
The message "Open this URL in your browser to review and authorize additional permissions" should have a full URL for the devcontainer specified by the user.
Logs
See above.