Repository navigation
feat: add Codespaces secrets CLI management script #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # Codespaces Secrets Management | ||
|
|
||
| GitHub Codespaces のシークレットとリポジトリの紐付けを CLI で管理します。 | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| /codespaces-secrets | ||
| /codespaces-secrets list | ||
| /codespaces-secrets sync | ||
| ``` | ||
|
|
||
| ## What It Does | ||
|
|
||
| GUI (https://github.com/settings/codespaces) を使わずに、Codespaces シークレットのリポジトリ紐付けを管理します。 | ||
|
|
||
| ### Features | ||
|
|
||
| - **シークレット一覧**: 現在のシークレットと紐付けリポジトリを表示 | ||
| - **リポジトリ管理**: 管理対象リポジトリの追加・削除 | ||
| - **一括同期**: 設定ファイルのリポジトリを全シークレットに紐付け | ||
| - **差分表示**: 設定と現在の状態の差分を確認 | ||
|
|
||
| ### Configuration | ||
|
|
||
| 設定ファイルは `~/.config/codespaces-secrets/repos.txt` に保存されます(Git管理外)。 | ||
|
|
||
| ## Commands | ||
|
|
||
| ```bash | ||
| # シークレットと紐付けリポジトリを表示 | ||
| ./script/codespaces-secrets.sh list | ||
|
|
||
| # 管理対象リポジトリ一覧を表示 | ||
| ./script/codespaces-secrets.sh repos | ||
|
|
||
| # リポジトリを追加 | ||
| ./script/codespaces-secrets.sh repos add owner/repo | ||
|
|
||
| # リポジトリを削除 | ||
| ./script/codespaces-secrets.sh repos remove owner/repo | ||
|
|
||
| # エディタで設定ファイルを編集 | ||
| ./script/codespaces-secrets.sh repos edit | ||
|
|
||
| # 設定と現在の状態の差分を表示 | ||
| ./script/codespaces-secrets.sh diff | ||
|
|
||
| # 全シークレットにリポジトリを紐付け | ||
| ./script/codespaces-secrets.sh sync | ||
|
|
||
| # 特定のシークレットにリポジトリを紐付け | ||
| ./script/codespaces-secrets.sh sync SECRET_NAME | ||
|
|
||
| # 現在の設定からファイルを初期化 | ||
| ./script/codespaces-secrets.sh init | ||
| ``` | ||
|
|
||
| ## Example Output | ||
|
|
||
| ``` | ||
| === Codespaces シークレット一覧 === | ||
|
|
||
| LINEAR_API_KEY | ||
| - Elu-co-jp/project-a | ||
| - keito4/my-project | ||
|
|
||
| NODE_AUTH_TOKEN | ||
| - Elu-co-jp/project-a | ||
|
|
||
| OP_SERVICE_ACCOUNT_TOKEN | ||
| - Elu-co-jp/project-a | ||
| - Elu-co-jp/project-b | ||
| - keito4/my-project | ||
| ``` | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. **初期化**: `./script/codespaces-secrets.sh init` で現在の設定を取得 | ||
| 2. **リポジトリ追加**: `./script/codespaces-secrets.sh repos add owner/repo` で対象リポジトリを追加 | ||
| 3. **差分確認**: `./script/codespaces-secrets.sh diff` で同期が必要なシークレットを確認 | ||
| 4. **同期**: `./script/codespaces-secrets.sh sync` で全シークレットにリポジトリを紐付け | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| | Variable | Description | Default | | ||
| | ------------------------------- | ---------------------- | ------------------------------ | | ||
| | `CODESPACES_SECRETS_CONFIG_DIR` | 設定ディレクトリのパス | `~/.config/codespaces-secrets` | | ||
|
|
||
| ## Requirements | ||
|
|
||
| - GitHub CLI (`gh`) がインストールされ、認証済みであること | ||
| - 対象リポジトリへのアクセス権限 | ||
|
|
||
| ## Implementation | ||
|
|
||
| This command is implemented in `script/codespaces-secrets.sh`. | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a language identifier to the fenced code block to fix the markdownlint warning.
Per MD040, fenced code blocks should specify a language. This is example terminal output, so
textorconsolewould be appropriate:🧰 Tools
🪛 markdownlint-cli2 (0.20.0)
[warning] 61-61: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents