Skip to content

Commit c8c024b

Browse files
committed
chore(opencode): use opencode.jsonc so the rules can be commented
Rename opencode.json to opencode.jsonc and explain in comments why the file exists, how it combines with a contributor's global config and why `gh pr merge *` is left out. The rules themselves do not change. license-eye exempts `**/*.json` but not `.jsonc`, and fails on a .jsonc file without a header (checked with apache/skywalking-eyes:0.9.0, the image CI and docs/e2e.md use). The file therefore carries the same Apache header as the other source files.
1 parent 251dddb commit c8c024b

2 files changed

Lines changed: 32 additions & 8 deletions

File tree

‎opencode.json‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎opencode.jsonc‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2026 Han Li and contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// OpenCode project permissions, see https://opencode.ai/v2/docs/permissions/
16+
//
17+
// Allows three shell commands in OpenCode sessions in this repository, which a
18+
// contributor's global config may deny. Project rules are appended after the
19+
// global ones and the last matching rule wins, so each "allow" below overrides
20+
// such a "deny" and every other global rule stays. Project configuration
21+
// outranks global configuration, so this applies to everyone who uses OpenCode
22+
// here. Use "ask" instead of "allow" to be prompted for each use.
23+
//
24+
// "gh pr merge *" is left out on purpose: a global deny on it keeps working.
25+
{
26+
"$schema": "https://opencode.ai/config.json",
27+
"permissions": [
28+
{ "action": "shell", "resource": "git push *", "effect": "allow" },
29+
{ "action": "shell", "resource": "gh pr create *", "effect": "allow" },
30+
{ "action": "shell", "resource": "gh pr comment *", "effect": "allow" }
31+
]
32+
}

0 commit comments

Comments
 (0)