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

Commit 058bdde

Browse files
authored
feat: change default secret name to OPENCODE_AUTH (#3)
Simplified the default GitHub secret name from OPENCODE_AUTH_JSON to OPENCODE_AUTH for better readability and convention alignment.
1 parent 0e73090 commit 058bdde

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Create `~/.config/opencode/opencode-auth-sync.json`:
5151
|--------|------|---------|-------------|
5252
| `enabled` | boolean | `true` | Enable/disable the plugin |
5353
| `credentialsPath` | string | `~/.local/share/opencode/auth.json` | Path to OpenCode auth file |
54-
| `secretName` | string | `OPENCODE_AUTH_JSON` | GitHub secret name |
54+
| `secretName` | string | `OPENCODE_AUTH` | GitHub secret name |
5555
| `repositories` | string[] | `[]` | Repositories to sync (`owner/repo` format) |
5656
| `debounceMs` | number | `1000` | Debounce delay for file changes |
5757

@@ -78,15 +78,15 @@ jobs:
7878
- name: Setup OpenCode Auth
7979
run: |
8080
mkdir -p ~/.local/share/opencode
81-
echo '${{ secrets.OPENCODE_AUTH_JSON }}' > ~/.local/share/opencode/auth.json
81+
echo '${{ secrets.OPENCODE_AUTH }}' > ~/.local/share/opencode/auth.json
8282
```
8383
8484
### Extracting Specific Tokens
8585
8686
```yaml
8787
- name: Extract Anthropic Token
8888
run: |
89-
ANTHROPIC_TOKEN=$(echo '${{ secrets.OPENCODE_AUTH_JSON }}' | jq -r '.anthropic.access')
89+
ANTHROPIC_TOKEN=$(echo '${{ secrets.OPENCODE_AUTH }}' | jq -r '.anthropic.access')
9090
echo "::add-mask::$ANTHROPIC_TOKEN"
9191
echo "ANTHROPIC_API_KEY=$ANTHROPIC_TOKEN" >> $GITHUB_ENV
9292
```

cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async function main() {
145145
process.exit(0)
146146
}
147147

148-
const existingSecretName = existingConfig.secretName || "OPENCODE_AUTH_JSON"
148+
const existingSecretName = existingConfig.secretName || "OPENCODE_AUTH"
149149
const secretName = await p.text({
150150
message: "GitHub secret name",
151151
placeholder: existingSecretName,
@@ -201,7 +201,7 @@ async function main() {
201201
p.note(
202202
[
203203
`${color.dim("Plugin config:")} ~/.config/opencode/opencode-auth-sync.json`,
204-
`${color.dim("Secret name:")} ${secretName || "OPENCODE_AUTH_JSON"}`,
204+
`${color.dim("Secret name:")} ${secretName || "OPENCODE_AUTH"}`,
205205
`${color.dim("Repositories:")} ${(selectedRepos as string[]).length} selected`,
206206
"",
207207
...((selectedRepos as string[]).map((r) => ` ${color.green("✓")} ${r}`)),

lib/config.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,15 @@ describe("config merge integration", () => {
213213
enabled: true,
214214
debounceMs: 10000,
215215
credentialsPath: "~/.local/share/opencode/auth.json",
216-
secretName: "OPENCODE_AUTH_JSON",
216+
secretName: "OPENCODE_AUTH",
217217
repositories: ["org/repo1", "org/repo2"],
218218
}
219219
writeFileSync(testConfigPath, JSON.stringify(originalConfig))
220220

221221
const loaded = loadPluginConfigSync(testConfigPath)
222222
const reinstallUpdates = {
223223
repositories: ["org/repo1", "org/repo3"],
224-
secretName: "OPENCODE_AUTH_JSON",
224+
secretName: "OPENCODE_AUTH",
225225
}
226226
const merged = mergeConfig(loaded, reinstallUpdates)
227227

@@ -234,7 +234,7 @@ describe("DEFAULT_CONFIG", () => {
234234
test("has expected default values", () => {
235235
expect(DEFAULT_CONFIG.enabled).toBe(true)
236236
expect(DEFAULT_CONFIG.credentialsPath).toBe("~/.local/share/opencode/auth.json")
237-
expect(DEFAULT_CONFIG.secretName).toBe("OPENCODE_AUTH_JSON")
237+
expect(DEFAULT_CONFIG.secretName).toBe("OPENCODE_AUTH")
238238
expect(DEFAULT_CONFIG.repositories).toEqual([])
239239
expect(DEFAULT_CONFIG.debounceMs).toBe(1000)
240240
})

lib/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { AuthSyncConfig } from "./types"
77
export const DEFAULT_CONFIG: AuthSyncConfig = {
88
enabled: true,
99
credentialsPath: "~/.local/share/opencode/auth.json",
10-
secretName: "OPENCODE_AUTH_JSON",
10+
secretName: "OPENCODE_AUTH",
1111
repositories: [],
1212
debounceMs: 1000,
1313
}

opencode-auth-sync.example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://raw.githubusercontent.com/activadee/opencode-auth-sync/main/schema.json",
33
"enabled": true,
44
"credentialsPath": "~/.local/share/opencode/auth.json",
5-
"secretName": "OPENCODE_AUTH_JSON",
5+
"secretName": "OPENCODE_AUTH",
66
"repositories": [
77
"your-username/repo1",
88
"your-org/private-repo"

schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"secretName": {
2121
"type": "string",
22-
"default": "OPENCODE_AUTH_JSON",
22+
"default": "OPENCODE_AUTH",
2323
"description": "Name of the GitHub secret to create/update"
2424
},
2525
"repositories": {

0 commit comments

Comments
 (0)