Add --codespace flag to init command for devcontainer.json generation #5443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a
--codespaceflag togh aw initthat creates or updates.devcontainer/devcontainer.jsonwith GitHub Codespace token permissions for the current repository and read access togithubnext/gh-awreleases.Changes
--codespaceto init commandpkg/cli/codespace_init.go):.devcontainer/or repository rootmcr.microsoft.com/devcontainers/universal:2if none existsmergePermissions()helper to avoid overwriting existing valuesGetCurrentRepoSlug()): write access for actions, contents, workflows, issues, pull requests, discussionsgithubnext/gh-aw: read access for contents and metadataUsage
Generates:
{ "image": "mcr.microsoft.com/devcontainers/universal:2", "customizations": { "codespaces": { "repositories": { "owner/repo": { "permissions": { "actions": "write", "contents": "write", "workflows": "write", "issues": "write", "pull-requests": "write", "discussions": "write" } }, "githubnext/gh-aw": { "permissions": { "contents": "read", "metadata": "read" } } } } } }Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
go.googlesource.com/update-job-proxy /update-job-proxy(dns block)go.uber.org/update-job-proxy /update-job-proxy(dns block)gopkg.in/update-job-proxy /update-job-proxy(dns block)https://api.github.com/user/usr/bin/gh gh api user --jq .login(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.