This guide deploys one of the reusable workflows in a repository that consumes
this project. It covers all supported configuration sources: the supplied
default profiles, repository-owned local bundles, and organization-managed
central bundles.
For the individual input definitions, see the configuration reference. For authoring a local or central profile, see creating a configuration bundle.
| Workflow | Reusable workflow | Typical trigger | Required caller permissions |
|---|---|---|---|
| Documentation review | opencode-documentation-review.yml |
pull_request |
contents: read, issues: read, pull-requests: write |
| Issue feedback | opencode-issue-feedback.yml |
issues |
contents: read, issues: write |
| Release project review | opencode-release-project-review.yml |
workflow_dispatch, schedule, or a release wrapper |
contents: read, issues: write |
| Changelog update | opencode-changelog-update.yml |
pull_request_target with types: [labeled] |
contents: write, pull-requests: write |
Use the copy-ready wrappers under configuration-source examples when one matches the intended deployment.
- Add
OPENROUTER_API_KEYas an Actions secret in the consumer repository. Restrict its scope, credit limit, and lifetime. - Grant the calling job only the permissions in the table above. The caller,
not the reusable workflow, owns its
permissions:declaration. - If using a private central configuration repository, add a
CENTRAL_CONFIG_TOKENsecret with read-onlycontents: readaccess to that repository. - For a cross-repository release review, provide a separate
release_target_tokenscoped only to the reviewed target withcontents: readandissues: write. Do not rely on the caller'sGITHUB_TOKENfor another repository.
Choose exactly one source for a workflow invocation.
| Source | Use it when | configuration_ref |
Bundle location |
|---|---|---|---|
default |
A supplied profile is sufficient | Required: reviewed lowercase 40-character commit SHA | This workflow repository |
local |
The consuming repository owns its instructions | Omit it | Consumer repository's trusted default-branch checkout |
central |
An organization shares approved profiles | Required: reviewed lowercase 40-character commit SHA | Allowlisted central repository |
A profile name must match [a-z0-9][a-z0-9-]{0,62}. Remote references are
immutable commit SHAs: branches, tags, URLs, and partial SHAs are rejected.
The remote bundle pin is independent of the commit SHA used to pin the
reusable workflow in uses:.
Choose default to use a supplied profile unchanged. Pin both the reusable
workflow and the supplied bundle revision to a reviewed commit SHA. The
profiles currently supplied are documentation-review, issue-feedback, and
release-project-review.
jobs:
review:
uses: SecondSkoll/generic-agentic-workflows/.github/workflows/opencode-documentation-review.yml@<reviewed-workflow-sha>
permissions:
contents: read
issues: read
pull-requests: write
with:
configuration_source: default
configuration_ref: <same-reviewed-40-character-sha>
configuration_profile: documentation-review
focus: documentation
max_comments: 10
review_request_string: AI REVIEW REQUESTED
validate_only: true
secrets:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}Choose local when the repository needs its own reviewed instructions. Put
the bundle in .opencode/configuration/<profile>/ on the protected default
branch. No configuration_ref is accepted or needed: the workflow reads the
trusted caller checkout rather than pull-request content.
jobs:
review:
uses: SecondSkoll/generic-agentic-workflows/.github/workflows/opencode-documentation-review.yml@<reviewed-workflow-sha>
permissions:
contents: read
issues: read
pull-requests: write
with:
configuration_source: local
configuration_profile: team-docs-review
focus: documentation
max_comments: 5
validate_only: true
secrets:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}Create and validate the bundle before enabling the wrapper. The bundle authoring guide shows the required layout and maintenance process.
Choose central for a profile reviewed once and used by multiple repositories.
The source is an alias to the fixed allowlisted repository
SecondSkoll/generic-agentic-workflows-config; callers cannot provide a
repository name or URL. Pin its bundle commit independently.
jobs:
review:
uses: SecondSkoll/generic-agentic-workflows/.github/workflows/opencode-documentation-review.yml@<reviewed-workflow-sha>
permissions:
contents: read
issues: read
pull-requests: write
with:
configuration_source: central
configuration_ref: <reviewed-central-40-character-sha>
configuration_profile: documentation-review
focus: documentation
max_comments: 10
validate_only: true
secrets:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
central_config_token: ${{ secrets.CENTRAL_CONFIG_TOKEN }} # Required only if central is privatereview_request_string is optional and defaults to AI REVIEW REQUESTED.
Change it when the consumer repository uses a different case-sensitive phrase
to request another review after matching feedback has already been published.
Create a workflow under .github/workflows/ in the consumer repository. The
wrapper owns event filtering, concurrency, permissions, and secret forwarding;
the reusable workflow owns configuration validation, model execution, output
validation, publication, and provenance artifacts.
For example, a documentation-review wrapper can use pull_request and call
the default example above. For an issue-feedback wrapper, replace the
reusable workflow path with opencode-issue-feedback.yml, grant
issues: write, and use max_issues instead of max_comments.
Do not expose prompt text, agent or skill paths, model IDs, URLs, repository names, branches, tags, or mutable references as wrapper inputs. The reusable interface intentionally accepts only typed, bounded selectors.
Promote the wrapper through these stages:
- Commit it with
validate_only: true. This resolves the invocation, bundle, and effective policy and validates them—including anymidflight_commandsIDs, counts, phases, and overlap—without calling a model, fetching a release, checking out a target, running commands, or writing to GitHub. For changelog update, validation-only is narrower: it validates invocation inputs and stops before fetching the PR or resolving the bundle. - Review the run summary and redacted configuration/provenance artifacts.
- Replace
validate_only: truewithdry_run: true. This can invoke the model (both phases whenmidflight_commandsis configured), run the configured commands, and validate its output, but it does not publish feedback. - Inspect the generated result and artifacts.
- Remove
dry_runto allow publication.
validate_only and dry_run are mutually exclusive. At any stage, return to
a known-good workflow or remote-bundle SHA to roll back explicitly. For command
and midflight rollout and rollback behavior, see Run commands from a
configuration bundle and the operations
guide.
Each run uploads its available short-retention (14-day) redacted artifacts.
Configuration and policy files are absent when the run stops before those
stages, including changelog validate_only. Use the available files to confirm
the selected profile, remote SHA, output contract, model profile, and result
without exposing credentials, full prompts, raw model output, or full untrusted
content. See the operations guide for
rollback, incident response, and reliability limits.
The opencode-changelog-update.yml reusable workflow updates a designated
changelog file from an open pull request when a configurable label is added.
A consumer caller uses pull_request_target: types: [labeled]. Unlike
pull_request, this event makes the base repository's token and configured
secret available for fork PRs, which is necessary to publish the proposed
content as a comment. The workflow remains safe because it checks out the
trusted base, loads helper code from the pinned reusable-workflow revision,
and treats the PR head as data; it never checks out or executes PR-controlled
code or configuration.
The caller supports these changelog-specific defaults and selectors:
| Input | Default | Behavior |
|---|---|---|
label |
update-changelog |
Exact label required on the labeled event. |
target_file |
CHANGELOG.md |
Repository-relative file that the agent may edit. |
configuration_source |
default |
default, local, or the allowlisted central source. |
configuration_ref |
Empty | Required full commit SHA for default and central; omit for local. |
configuration_profile |
changelog-update |
Bundle that selects the reviewed prompt, agent, skills, model profile, contract, and policy. Use a custom reviewed local or central profile to customize that combination. |
pull_number |
0 |
Optional override when event context does not provide a PR number; the labelled-PR caller normally supplies the event number. |
dry_run |
false |
Runs the guard, model, and output validation and creates a preview artifact, but does not commit or comment. |
validate_only |
false |
Validates invocation inputs only, without fetching the PR, resolving the bundle, invoking the model, or publishing. |
The job requires contents: write and pull-requests: write, plus the required
OPENROUTER_API_KEY secret. Forward the optional central_config_token only
when a private central bundle needs it. See
docs/how-to/examples/configuration-sources/default/.github/workflows/changelog-update.yml
for a minimal caller. Its all-zero SHA values are deliberately invalid: the
example is not runnable until both are replaced with a reviewed 40-character
commit SHA.
The reusable workflow re-validates the event, action, exact label, PR number, and open PR state authoritatively. Ordinary issues, other event actions, closed PRs, and label mismatches are rejected before model invocation or publication; the reusable workflow has no direct event trigger of its own.
- Same-repo PRs: the workflow commits only the designated target file to the PR source branch through the GitHub Contents API, with the workflow marker in the commit message. Any extraneous edit fails before publication.
- Fork PRs: the workflow never pushes. It posts (or updates) a single marker PR comment containing the proposed target-file content for review.
- Re-adding the label: the workflow exits safely when, for a same-repo PR, its marker commit is the latest commit with no newer comment, or, for a fork PR, its marker comment is the newest comment and no newer fork commit followed it. Otherwise, it incorporates the current PR head: same-repo PRs receive another target-file commit and fork PRs regenerate the proposal and update the existing marker comment in place. A newer fork commit after the marker comment triggers a regeneration that PATCHes the existing marker comment.
dry_runproduces a publication preview only;dry_runandvalidate_onlyare mutually exclusive.