Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/opencode-changelog-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,14 @@ jobs:

- name: Install OpenCode
if: steps.resolve.outputs.validate_only != 'true' && steps.guard.outputs.action != 'skip'
run: npm install -g opencode-ai@1.18.16
# The postinstall script creates the real platform binary
# (bin/opencode.exe); npm's allow-scripts gate blocks it unless the
# exact-pinned package is allow-listed. The scoped flag permits only
# opencode-ai, with no wildcard or persistent npm config.
run: |
set -euo pipefail
npm install -g --allow-scripts=opencode-ai opencode-ai@1.18.16
opencode --version

- name: Generate changelog update
if: steps.resolve.outputs.validate_only != 'true' && steps.guard.outputs.action != 'skip'
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/opencode-documentation-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
description: Pull-request number to review
required: true
type: string
review_request_string:
description: Comment substring that requests an additional review after prior feedback
required: false
type: string
default: 'AI REVIEW REQUESTED'
workflow_call:
inputs:
configuration_source:
Expand Down Expand Up @@ -50,6 +55,11 @@ on:
type: number
required: false
default: 0
review_request_string:
description: Comment substring that requests an additional review after prior feedback
type: string
required: false
default: 'AI REVIEW REQUESTED'
secrets:
OPENROUTER_API_KEY:
required: true
Expand All @@ -62,6 +72,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
pull-requests: write
env:
FEEDBACK_KIND: pr-documentation-review
Expand Down Expand Up @@ -115,6 +126,7 @@ jobs:
AGENTIC_DRY_RUN: ${{ inputs.dry_run || false }}
AGENTIC_VALIDATE_ONLY: ${{ inputs.validate_only || false }}
AGENTIC_TARGET_NUMBER: ${{ inputs.pull_number || github.event.pull_request.number || '' }}
AGENTIC_REVIEW_REQUEST_STRING: ${{ inputs.review_request_string || 'AI REVIEW REQUESTED' }}
run: |
set -euo pipefail
python3 "$AGENTIC_WORKFLOW_ROOT/scripts/resolve_invocation.py" \
Expand All @@ -127,6 +139,7 @@ jobs:
--dry-run "$AGENTIC_DRY_RUN" \
--validate-only "$AGENTIC_VALIDATE_ONLY" \
--target-number "$AGENTIC_TARGET_NUMBER" \
--review-request-string "$AGENTIC_REVIEW_REQUEST_STRING" \
--github-output "$GITHUB_OUTPUT" \
--github-step-summary "$GITHUB_STEP_SUMMARY" \
--result "$RUNNER_TEMP/resolved-invocation.json"
Expand Down Expand Up @@ -334,7 +347,14 @@ jobs:
if: steps.resolve.outputs.validate_only != 'true'
# Keep CLI parsing stable; `--file` accepts multiple paths in current
# OpenCode releases, so unpinned updates can change invocation behavior.
run: npm install -g opencode-ai@1.18.16
# The postinstall script creates the real platform binary
# (bin/opencode.exe); npm's allow-scripts gate blocks it unless the
# exact-pinned package is allow-listed. The scoped flag permits only
# opencode-ai, with no wildcard or persistent npm config.
run: |
set -euo pipefail
npm install -g --allow-scripts=opencode-ai opencode-ai@1.18.16
opencode --version

- name: Review documentation impact
if: steps.resolve.outputs.validate_only != 'true'
Expand All @@ -345,6 +365,7 @@ jobs:
DRY_RUN: ${{ steps.resolve.outputs.dry_run }}
FOCUS: ${{ steps.resolve.outputs.focus }}
MAX_COMMENTS: ${{ steps.resolve.outputs.max_comments }}
REVIEW_REQUEST_STRING: ${{ steps.resolve.outputs.review_request_string }}
run: |
review_args=(
--input pr.diff
Expand All @@ -364,6 +385,7 @@ jobs:
--response-diagnostics "$RUNNER_TEMP/opencode-response-diagnostics.json"
--publication-preview "$RUNNER_TEMP/agentic-publication-preview.json"
)
review_args+=(--review-request-string "$REVIEW_REQUEST_STRING")
if [[ "$FAIL_IF_REVIEWED" == "true" ]]; then
review_args+=(--fail-if-reviewed)
fi
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/opencode-issue-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,14 @@ jobs:

- name: Install OpenCode
if: steps.resolve.outputs.validate_only != 'true'
run: npm install -g opencode-ai@1.18.16
# The postinstall script creates the real platform binary
# (bin/opencode.exe); npm's allow-scripts gate blocks it unless the
# exact-pinned package is allow-listed. The scoped flag permits only
# opencode-ai, with no wildcard or persistent npm config.
run: |
set -euo pipefail
npm install -g --allow-scripts=opencode-ai opencode-ai@1.18.16
opencode --version

- name: Collect open issues
if: steps.resolve.outputs.validate_only != 'true'
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/opencode-issue-implementation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,14 @@ jobs:
node-version: '24'

- name: Install OpenCode
run: npm install -g opencode-ai@1.18.16
# The postinstall script creates the real platform binary
# (bin/opencode.exe); npm's allow-scripts gate blocks it unless the
# exact-pinned package is allow-listed. The scoped flag permits only
# opencode-ai, with no wildcard or persistent npm config.
run: |
set -euo pipefail
npm install -g --allow-scripts=opencode-ai opencode-ai@1.18.16
opencode --version

- name: Create implementation prompt
id: context
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/opencode-release-project-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,14 @@ jobs:

- name: Install OpenCode
if: steps.resolve.outputs.validate_only != 'true'
run: npm install -g opencode-ai@1.18.16
# The postinstall script creates the real platform binary
# (bin/opencode.exe); npm's allow-scripts gate blocks it unless the
# exact-pinned package is allow-listed. The scoped flag permits only
# opencode-ai, with no wildcard or persistent npm config.
run: |
set -euo pipefail
npm install -g --allow-scripts=opencode-ai opencode-ai@1.18.16
opencode --version

- name: Resolve release and prove target access
if: steps.resolve.outputs.validate_only != 'true'
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/verify-reusable-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ jobs:
node-version: '24'

- name: Install OpenCode for schema smoke checks
run: npm install -g opencode-ai@1.18.16
# The postinstall script creates the real platform binary
# (bin/opencode.exe); npm's allow-scripts gate blocks it unless the
# exact-pinned package is allow-listed. The scoped flag permits only
# opencode-ai, with no wildcard or persistent npm config.
run: |
set -euo pipefail
npm install -g --allow-scripts=opencode-ai opencode-ai@1.18.16
opencode --version

- name: Run unit tests (includes real OpenCode smoke when binary present)
run: uv run python -m unittest discover -s tests -v
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ commit SHA; resolution failures fail closed.

| Workflow | Interface | Required publication permissions |
| --- | --- | --- |
| `.github/workflows/opencode-documentation-review.yml` | Direct PR trigger or reusable call | `contents: read`, `pull-requests: write` |
| `.github/workflows/opencode-documentation-review.yml` | Direct PR trigger or reusable call | `contents: read`, `issues: read`, `pull-requests: write` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The column is labeled Required publication permissions, but issues: read is needed to inspect comments and reviews for re-review eligibility; it is not a publication permission. Please rename this column to Required permissions (and update the matching tables in the configuration and docs index pages) or separate read and publication permissions.

| `.github/workflows/opencode-issue-feedback.yml` | Direct issue trigger or reusable call | `contents: read`, `issues: write` |
| `.github/workflows/opencode-issue-implementation.yml` | Manual dispatch only | `contents: write`, `issues: write`, `pull-requests: write` |
| `.github/workflows/opencode-release-project-review.yml` | Manual dispatch or reusable call only | `contents: read`, `issues: write` (plus a target-scoped `release_target_token` for cross-repository reviews) |
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For field-by-field definitions and complete bundle-file examples, see the

| Workflow | Publication permissions |
| --- | --- |
| PR review | `contents: read`, `pull-requests: write` |
| PR review | `contents: read`, `issues: read`, `pull-requests: write` |
| Issue feedback | `contents: read`, `issues: write` |

`validate_only` does not invoke a model or write to GitHub. `dry_run` can
Expand Down
10 changes: 9 additions & 1 deletion docs/how-to/deploy-a-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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`, `pull-requests: write` |
| 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` |
Expand Down Expand Up @@ -66,13 +66,15 @@ jobs:
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 }}
Expand All @@ -91,6 +93,7 @@ jobs:
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
Expand Down Expand Up @@ -119,6 +122,7 @@ jobs:
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
Expand All @@ -132,6 +136,10 @@ jobs:
central_config_token: ${{ secrets.CENTRAL_CONFIG_TOKEN }} # Required only if central is private
```

`review_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.

## 4. Add a wrapper workflow

Create a workflow under `.github/workflows/` in the consumer repository. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:

permissions:
contents: read
issues: read
pull-requests: write

jobs:
review:
uses: SecondSkoll/generic-agentic-workflows/.github/workflows/opencode-documentation-review.yml@186fc769bdcc2a711b8321df7c2949a09c48578b
permissions:
contents: read
issues: read
pull-requests: write
with:
configuration_source: central
Expand All @@ -22,4 +24,4 @@ jobs:
max_comments: 10
validate_only: true
secrets:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:

permissions:
contents: read
issues: read
pull-requests: write

jobs:
review:
uses: SecondSkoll/generic-agentic-workflows/.github/workflows/opencode-documentation-review.yml@186fc769bdcc2a711b8321df7c2949a09c48578b
permissions:
contents: read
issues: read
pull-requests: write
with:
configuration_source: default
Expand All @@ -22,4 +24,4 @@ jobs:
max_comments: 10
validate_only: true
secrets:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
3 changes: 2 additions & 1 deletion docs/how-to/examples/configuration-sources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ enabled safely. Set `validate_only: true` on the changelog caller for the same
staged rollout. After verifying the resolution artifact, change `validate_only: true`
to `dry_run: true`, and then remove the flag to publish feedback. The
repository must define the `OPENROUTER_API_KEY` Actions secret before leaving
validation-only mode. Documentation review needs `pull-requests: write`;
validation-only mode. Documentation review needs `issues: read` and
`pull-requests: write`;
issue feedback needs `issues: write`; release project review needs
`issues: write` and, for cross-repository reviews, a target-scoped
`release_target_token` with `contents: read` and `issues: write` on the target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:

permissions:
contents: read
issues: read
pull-requests: write

jobs:
review:
uses: SecondSkoll/generic-agentic-workflows/.github/workflows/opencode-documentation-review.yml@186fc769bdcc2a711b8321df7c2949a09c48578b
permissions:
contents: read
issues: read
pull-requests: write
with:
configuration_source: local
Expand All @@ -21,4 +23,4 @@ jobs:
max_comments: 5
validate_only: true
secrets:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ feedback, and uploads redacted provenance.

| Workflow | Interface | Required publication permissions |
| --- | --- | --- |
| Documentation review | Direct pull-request trigger or reusable call | `contents: read`, `pull-requests: write` |
| Documentation review | Direct pull-request trigger or reusable call | `contents: read`, `issues: read`, `pull-requests: write` |
| Issue feedback | Direct issue trigger or reusable call | `contents: read`, `issues: write` |
| Issue implementation | Manual dispatch only | `contents: write`, `issues: write`, `pull-requests: write` |
| Release project review | Manual dispatch or reusable call | `contents: read`, `issues: write` |
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Fields not applicable to the selected workflow are rejected.
| `dry_run` | boolean | Both | `false` | Resolves configuration, invokes the model, and validates output, but does not publish feedback. Cannot be `true` with `validate_only`. |
| `validate_only` | boolean | All workflows | `false` | Validates without invoking a model or publishing. Changelog update validates invocation inputs and stops before PR fetch and bundle resolution; other reusable workflows also resolve and validate configuration. Cannot be `true` with `dry_run`. |
| `pull_number` | number | PR review, changelog update | `0` | Optional positive PR number when no pull-request event provides the target. Changelog update requires an effective PR number, normally from the caller's event context. |
| `review_request_string` | string | PR review | `'AI REVIEW REQUESTED'` | Whitespace is stripped. The result must be non-empty, contain no control characters, and be at most 128 characters. When matching prior feedback exists, a non-bot issue comment containing this substring case-sensitively and created strictly after the bot's latest issue comment or PR review authorizes a new review. Rejected for other workflows. |
| `issue_number` | number | Issue feedback | `0` | Optional positive issue number when no issue event provides the target. |
| `target_repository` | string | Release project review | `${{ github.repository }}` | Strict canonical `owner/repo` of the release to review. Required for `workflow_call`; a direct dispatch defaults to the caller repository. Rejects URLs, `owner/repo@ref`/`owner/repo:ref` syntax, paths, and expressions. |
| `release_id` | string | Release project review | Empty | Positive decimal GitHub release ID. The reusable workflow accepts a string because workflow-job outputs are strings; it validates the value as a positive integer. Exactly one of `release_id`/`release_tag` is required. |
Expand All @@ -53,6 +54,7 @@ jobs:
uses: organization/generic-agentic-workflows/.github/workflows/opencode-documentation-review.yml@<reviewed-workflow-sha>
permissions:
contents: read
issues: read
pull-requests: write
with:
configuration_source: default
Expand Down
10 changes: 8 additions & 2 deletions docs/reference/operations-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,18 @@ controls as the target content.

| Workflow | Marker | Suppression rule |
| --- | --- | --- |
| PR review | `<!-- agentic-workflow:pr-documentation-review:v2:<digest>:<head_sha> -->` | Same digest and head SHA |
| PR review | `<!-- agentic-workflow:pr-documentation-review:v2:<digest>:<head_sha> -->` | Same digest and head SHA, unless a non-bot comment containing the configured review request string (`AI REVIEW REQUESTED` by default) exists after the bot's most recent review or comment |
| Issue feedback | `<!-- agentic-workflow:issue-feedback:v2:<digest> -->` | Same digest |
| Issue implementation status | `<!-- agentic-workflow:issue-implementation-status:v1 -->` | Records the result of an explicitly dispatched issue run |
| Release project review | `<!-- agentic-workflow:release-project-review:v2:<idempotency_key>:<target_commit_sha> -->` | Same canonical target, release ID, target commit SHA, configuration digest, and workflow version |
| Changelog update | `<!-- agentic-workflow:pr-changelog-update:v1 -->` | Same-repo: marker is the newest commit and no newer comment exists. Fork: marker is the newest comment and no newer commit followed it; a newer fork commit regenerates and PATCHes the existing marker comment in place. |

The documentation-review workflow scans for a re-review request only after it
finds a matching PR-review marker. A first review proceeds without scanning
issue comments or PR reviews. The request match is case-sensitive and must be
in a non-bot issue comment created strictly after the latest bot-authored issue
comment or PR review.

A changed remote bundle SHA or changed local bundle content creates a new
configuration digest. A new digest intentionally creates a new feedback
identity.
Expand Down Expand Up @@ -117,5 +123,5 @@ refetched. The cache lasts for one workflow run.
| Resolution or validation | Fails closed without falling back to another ref, local profile, or stale configuration. |
| Provider | Records a redacted operational failure and posts no partial feedback. |
| Publication | Preserves provenance with `result: "failed"` for investigation. |
| Duplicate feedback | Skips publication and records `result: "skipped"`. |
| Duplicate feedback | Skips publication and records `result: "skipped"`, unless a non-bot comment containing the configured review request string (`AI REVIEW REQUESTED` by default) was created after the bot's most recent review or comment; then the review re-runs. |
| Rollback | Requires a maintainer-controlled pinned SHA change; automatic unreviewed rollback is unsupported. |
Loading
Loading