Skip to content

Let the OpenCode agent push, open pull requests and comment on them - #49

Merged
linghengqian merged 5 commits into
mainfrom
chore/opencode-permissions
Nov 3, 2026
Merged

linghengqian merged 5 commits into
mainfrom
chore/opencode-permissions

Conversation

@linghengqian

Copy link
Copy Markdown
Member
  • Adds opencode.jsonc, the project configuration of OpenCode, with allow rules for the shell commands git push *, gh pr create * and gh pr comment *.
  • A user can deny these commands for every project in ~/.config/opencode/opencode.json. OpenCode applies the rules of a project after those of the user, and the last rule that matches wins, so with this file the agent can deliver a change in this repository: push its branch, open the pull request and comment on it. gh pr merge is not among the rules and stays with the user's own configuration.
  • The file is committed, so it applies to everybody who uses OpenCode in this repository, and it overrides a personal deny or ask for these three commands.
  • .licenserc.yaml ignores *.json but not *.jsonc, so the file starts with the Apache-2.0 header, like the other files that can carry comments.
  • opencode debug config lists opencode.jsonc after the global configuration, with the three rules.
  • With a global configuration that denies git push *, gh pr create *, gh pr comment * and gh pr merge *, the commands git push -h, gh pr create --help and gh pr comment --help (which only print their usage) were rejected before the file existed and ran after it, without a restart of OpenCode. gh pr merge --help is still rejected.
  • SkyWalking Eyes 0.9.0, the version of CI, accepts the header, and the same file without it fails.
  • Not tried: a global ask instead of deny, for which the documented order is the same.

linghengqian and others added 5 commits November 3, 2026 10:57
Add opencode.jsonc, the project configuration of OpenCode, with allow rules for
the shell commands git push, gh pr create and gh pr comment.

A user can deny these commands for every project in
~/.config/opencode/opencode.json. OpenCode applies the rules of a project after
those of the user, and the last rule that matches wins, so in this repository
the agent can push its branch, open the pull request and comment on it.
gh pr merge is not among the rules and stays with the user's own configuration.
…x/tools 0.52.0

golang.org/x/mod 0.42.0 and golang.org/x/net 0.61.0 follow as indirect
dependencies. This is the change of the Dependabot pull request #47.
…-gradle 6.4.1, download-artifact 8.0.2

This is the change of the Dependabot pull request #48. The actions stay pinned
to commit SHAs.
The default package list of setup-android used to name the `tools` package,
which Google removed, so the workflow asked for `platform-tools` alone.
setup-android 4.0.2 fixed that: the default is now `platform-tools`, which is
what the workflow asked for. The list and the comment that explained it are no
longer needed.
setup-gradle 6 moved the Gradle User Home caching into gradle-actions-caching,
a closed-source component under the Gradle Technologies Terms of Use, and made
it the default: upgrading to v6 accepts those terms. Since 6.1.0 the MIT-licensed
`basic` provider, built on actions/cache, is an alternative, and the component
is neither loaded nor used with it. Choose it, so that the workflow stays on
open-source components, as it was with v5.

`basic` has no cache cleanup and no deduplication, and starts a new cache when
a build file changes. To take the default again, delete the line.
@linghengqian linghengqian added the enhancement New feature or request label Nov 3, 2026
@linghengqian
linghengqian merged commit 8aaa978 into main Nov 3, 2026
13 checks passed
@linghengqian
linghengqian deleted the chore/opencode-permissions branch November 3, 2026 03:23
@linghengqian linghengqian added this to the 1.0.0 milestone Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant