feat: add PR walkthrough generation workflow (#2933)

This commit is contained in:
Carlos Florêncio
2026-08-22 21:46:57 +01:00
committed by GitHub
parent 906be89036
commit eb0df0a492
31 changed files with 4852 additions and 34 deletions
+16 -34
View File
@@ -9,10 +9,6 @@ on:
# re-use the maintainer's approval for the new head.
types: [opened, synchronize, ready_for_review, reopened, labeled]
concurrency:
group: opencode-review-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
OPENCODE_MODEL: opencode-go/minimax-m3
@@ -23,8 +19,13 @@ jobs:
github.event_name == 'pull_request_target' &&
github.event.pull_request.draft == false &&
github.event.pull_request.head.repo.full_name == github.repository &&
(github.event.action != 'labeled' ||
github.event.label.name != 'generate-pr-walkthrough') &&
vars.OPENCODE_REVIEW_APP_CLIENT_ID != '' &&
vars.OPENCODE_REVIEW_APP_SLUG != ''
concurrency:
group: opencode-review-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
timeout-minutes: 15
environment: opencode-review-trusted
@@ -57,7 +58,9 @@ jobs:
REVIEW_DIR=.opencode-review
rm -rf "$REVIEW_DIR"
mkdir -p "$REVIEW_DIR"
rm -rf .trusted-actions/setup-opencode
mkdir -p "$REVIEW_DIR" .trusted-actions/setup-opencode
git show "$BASE_SHA:.github/actions/setup-opencode/action.yml" > .trusted-actions/setup-opencode/action.yml
RANGE="$BASE_SHA...$HEAD_SHA"
MODE="full-pr"
@@ -86,20 +89,7 @@ jobs:
} >> "$GITHUB_OUTPUT"
- name: Install OpenCode
env:
OPENCODE_VERSION: v1.17.7
OPENCODE_SHA256: 60fe5a92dc9af64ec079348fedde17e12da6a867efe7e8353be8038480607924
run: |
set -euo pipefail
curl -fsSL \
-o /tmp/opencode.tar.gz \
"https://github.com/anomalyco/opencode/releases/download/${OPENCODE_VERSION}/opencode-linux-x64.tar.gz"
echo "${OPENCODE_SHA256} /tmp/opencode.tar.gz" | sha256sum -c -
mkdir -p "$HOME/.opencode/bin"
tar -xzf /tmp/opencode.tar.gz -C "$HOME/.opencode/bin"
chmod +x "$HOME/.opencode/bin/opencode"
"$HOME/.opencode/bin/opencode" --version
uses: ./.trusted-actions/setup-opencode
- name: Run OpenCode review
env:
@@ -253,6 +243,9 @@ jobs:
github.event.pull_request.head.repo.full_name != github.repository &&
((contains(github.event.pull_request.labels.*.name, 'safe-to-review')) ||
(vars.OPENCODE_REVIEW_ALLOWLIST != '' && contains(fromJSON(vars.OPENCODE_REVIEW_ALLOWLIST), github.event.pull_request.user.login)))
concurrency:
group: opencode-review-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
@@ -284,8 +277,10 @@ jobs:
REVIEW_DIR=.opencode-review
rm -rf "$REVIEW_DIR"
mkdir -p "$REVIEW_DIR"
rm -rf .trusted-actions/setup-opencode
mkdir -p "$REVIEW_DIR" .trusted-actions/setup-opencode
git fetch --no-tags --prune origin "$BASE_SHA"
git show "$BASE_SHA:.github/actions/setup-opencode/action.yml" > .trusted-actions/setup-opencode/action.yml
RANGE="$BASE_SHA...$HEAD_SHA"
MODE="full-pr"
@@ -314,20 +309,7 @@ jobs:
} >> "$GITHUB_OUTPUT"
- name: Install OpenCode
env:
OPENCODE_VERSION: v1.17.7
OPENCODE_SHA256: 60fe5a92dc9af64ec079348fedde17e12da6a867efe7e8353be8038480607924
run: |
set -euo pipefail
curl -fsSL \
-o /tmp/opencode.tar.gz \
"https://github.com/anomalyco/opencode/releases/download/${OPENCODE_VERSION}/opencode-linux-x64.tar.gz"
echo "${OPENCODE_SHA256} /tmp/opencode.tar.gz" | sha256sum -c -
mkdir -p "$HOME/.opencode/bin"
tar -xzf /tmp/opencode.tar.gz -C "$HOME/.opencode/bin"
chmod +x "$HOME/.opencode/bin/opencode"
"$HOME/.opencode/bin/opencode" --version
uses: ./.trusted-actions/setup-opencode
- name: Run OpenCode review
env: