This repository includes GitHub Actions workflows that use OpenCode with the OpenCode Go provider for issue planning and implementation.
Set these repository secrets in GitHub Actions:
OPENCODE_GO_API_KEY: your OpenCode Go API key.GH_WORKFLOW_PAT: a personal access token withrepo(contents) andpull_requestswrite scopes, used byupdate-publications.ymlandopencode.ymlfor checkout and PR creation.OPENCODE_ORG_TOKEN(optional): a GitHub token withread:orgscope, used by thecheck-authjob to verify organization membership. If not set, authorization falls back to.github/opencode-allowlist.txt.
Set these repository variables if you want to override the workflow defaults:
OPENCODE_PLAN_MODEL: defaults toopencode-go/kimi-k2.7-codeOPENCODE_BUILD_MODEL: defaults toopencode-go/deepseek-v4-pro
Validated available OpenCode Go models currently used by this repository:
opencode-go/kimi-k2.7-codeopencode-go/deepseek-v4-proopencode-go/deepseek-v4-flash
If you override the workflow variables, use model IDs returned by https://opencode.ai/zen/go/v1/models.
Use these commands to trigger the workflows on issues and pull requests:
/plan: OpenCode reads the full issue discussion and replies with an implementation plan. Also triggered automatically when a se-polinema organization member opens a new issue with a title or body starting with/plan./build: OpenCode implements the approved plan, runsnpm run buildagainst both the production and beta base paths, captures a screenshot, and opens or updates a pull request intodevelop.
Notes:
- These commands work on new comments and edited comments, both on issues and pull requests.
- They also work in pull request review comments and pull request review submissions.
/planand/buildmay include extra text after the command.- The implementation branch uses the exact pattern
opencode/issue-{number}, created frommain. - Merging the
/buildPR deploys the change to beta (https://se.polinema.ac.id/beta/) for validation; it does not close the original issue, since GitHub only auto-closes issues on merges to the default branch (main). Promotion to production is a separate, manually opened PR from the sameopencode/issue-{number}branch intomain; that PR'sCloses #{number}is what finishes the issue. See "Release Flow" below.
After OpenCode opens a pull request, reviewers can iterate on the implementation without opening a new issue:
- A plan is created on an issue and a PR is opened via
/build. - A reviewer provides feedback on the PR by commenting
/plan <feedback>or/build <feedback>in a:- PR comment (conversation tab)
- PR review comment (on a diff line)
- PR review submission body
- When
/plan <feedback>is used on a PR, OpenCode posts a revised plan back on the original issue. - When
/buildis then used (on the issue or PR), OpenCode checks out the existingopencode/issue-{number}branch, applies the revisions, and pushes a new commit. The existing PR is updated automatically.
This enables an Agentic AI feedback loop where reviewers can refine the implementation iteratively within the same issue and PR.
Only authorized members can trigger /plan and /build. Authorization is checked in two ways:
- Authenticated API check: queries
https://api.github.com/orgs/se-polinema/members/{actor}usingOPENCODE_ORG_TOKEN(a token withread:orgscope). If the token is not configured, this check is skipped. - Fallback allowlist: checks
.github/opencode-allowlist.txtin this repository. Add one GitHub username per line to grant access without requiring org membership visibility.
If either check passes, the user is authorized.
- OpenCode provider usage is restricted to
opencode-gothroughopencode.json. - Both commands are handled by a single workflow (
.github/workflows/opencode.yml) with two jobs (planandbuild), reducing skipped-run noise in the Actions tab. - The
planjob runs on/plancomments and does not edit files or create branches. - The
buildjob runs on/buildcomments and updates the pull request with a screenshot captured from the generated change.
The implementation workflow requires these permissions:
contents: writepull-requests: writeissues: write
The site deploys two environments from one GitHub Pages site (.github/workflows/deploy.yml):
- Production: builds from
main, served at the site root (https://se.polinema.ac.id/). - Beta: builds from
develop, served underhttps://se.polinema.ac.id/beta/.
Every push to either branch rebuilds both and redeploys the merged artifact, so the two environments are always in sync with their respective branch tips. A missing or broken develop branch never blocks the production deploy (the beta build job is non-blocking).
Rule for shipping a change:
- Branch from
mainfor a feature/fix (feature-branch). - Open a PR from
feature-branchintodevelop. Merging deploys it to beta for validation. - Once validated on beta, open a second PR from the same
feature-branchintomain. Merging deploys it to production.
Do not merge develop into main wholesale — each change ships to production through its own PR against main, after being validated on beta. Both main and develop are protected branches (PRs required, no direct pushes, no force pushes).
OpenCode /build PRs follow this same flow automatically: the opencode/issue-{number} branch targets develop first, and promotion to main is the same manual step 3 above.
The beta build sets BASE_PATH=/beta/ (read by astro.config.mjs); production leaves it unset and serves from /. Because of this, source code must never hardcode a root-absolute path (href="/members", fetch('/api/...'), src="/images/..."). Use the helpers in src/lib/paths.ts instead:
withBase(path): prefixes a base-free path for hrefs,srcattributes,fetch()calls, and redirects. Safe to call on external URLs (passes them through unchanged).stripBase(pathname): inverse, for comparing againstwindow.location.pathname.
Store paths base-free and call withBase() once, at the render or navigation edge.