ci: add automated agent workflows — review, fix, maintenance, batch-merge
CI / lint (push) Successful in 1m4s
CI / sanitizers (address) (push) Successful in 36s
CI / sanitizers (undefined) (push) Successful in 36s
CI / fuzz-build (push) Successful in 14s
CI / coverage (push) Successful in 31s
CI / build-and-test (push) Successful in 1m15s
CI / valgrind (push) Successful in 32s

This commit is contained in:
2026-07-30 18:24:29 +02:00
parent da20bb4d37
commit 3d2eb97205
5 changed files with 152 additions and 1 deletions
+38
View File
@@ -0,0 +1,38 @@
name: Agent Batch Merge
on:
workflow_dispatch:
inputs:
branches:
description: "Comma-separated branches to merge (e.g., fix/a,fix/b)"
required: true
jobs:
batch-merge:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v9
steps:
- uses: actions/checkout@v4
with:
ref: dev
fetch-depth: 0
- name: Merge all branches
run: |
IFS=',' read -ra BRANCHES <<< "${{ github.event.inputs.branches }}"
for branch in "${BRANCHES[@]}"; do
branch=$(echo "$branch" | xargs)
git fetch origin "$branch"
git merge "origin/$branch" --no-edit || true
done
- name: Build and test
run: |
cmake -B build -S . && cmake --build build -j$(nproc)
./build/tests
python3 -m pytest tests/ -v --tb=short
- name: Commit and push
run: |
git add -A
git commit -m "batch-merge: ${{ github.event.inputs.branches }}" || true
git push origin dev
+43
View File
@@ -0,0 +1,43 @@
name: Agent Issue Fix
on:
issue_comment:
types: [created]
jobs:
fix:
if: contains(github.event.comment.body, '/opencode fix')
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v9
steps:
- uses: actions/checkout@v4
with:
ref: dev
fetch-depth: 0
- name: Install opencode
run: npm install -g opencode-ai
- name: Create fix branch and implement
run: |
ISSUE_NUM="${{ github.event.issue.number }}"
BRANCH="auto-fix/issue-${ISSUE_NUM}"
git checkout -b "$BRANCH" origin/dev
opencode run \
"Fix this issue: ${{ github.event.issue.body }}"
git add -A
git commit -m "auto-fix: address issue #${ISSUE_NUM}" || true
git push origin "$BRANCH"
- name: Create PR
run: |
ISSUE_NUM="${{ github.event.issue.number }}"
TITLE="${{ github.event.issue.title }}"
curl -s -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{
\"title\": \"Fix: ${TITLE:0:80}\",
\"body\": \"Automated fix for issue #${ISSUE_NUM}\n\nCloses #${ISSUE_NUM}\",
\"head\": \"auto-fix/issue-${ISSUE_NUM}\",
\"base\": \"dev\"
}" \
"https://gitea.tap-tap.win/api/v1/repos/${{ github.repository }}/pulls"
+26
View File
@@ -0,0 +1,26 @@
name: Agent Scheduled Maintenance
on:
schedule:
- cron: "0 6 * * 1"
jobs:
audit:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v9
steps:
- uses: actions/checkout@v4
with:
ref: dev
- name: Install opencode
run: npm install -g opencode-ai
- name: Security audit
run: |
opencode run --agent security-auditor \
"Audit the codebase for vulnerabilities. Create issues for any findings via the Gitea API at https://gitea.tap-tap.win/api/v1/repos/${{ github.repository }}/issues using token ${{ secrets.GITEA_TOKEN }}"
- name: Code quality scan
run: |
opencode run --agent code-quality-guardian \
"Scan for code quality issues. Create issues for any findings via the Gitea API at https://gitea.tap-tap.win/api/v1/repos/${{ github.repository }}/issues using token ${{ secrets.GITEA_TOKEN }}"
+44
View File
@@ -0,0 +1,44 @@
name: Agent PR Review
on:
pull_request:
types: [opened, synchronize, ready_for_review]
jobs:
review:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v9
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install opencode
run: npm install -g opencode-ai
- name: Run security audit review
run: |
opencode run --agent security-auditor \
"Review this PR for security vulnerabilities" \
> /tmp/security-review.md 2>&1 || true
- name: Run code quality review
run: |
opencode run --agent code-quality-guardian \
"Review this PR for code quality issues" \
> /tmp/quality-review.md 2>&1 || true
- name: Post combined review
run: |
{
echo "## Agent Review Report"
echo ""
echo "### Security Audit"
cat /tmp/security-review.md 2>/dev/null || echo "No security issues found."
echo ""
echo "### Code Quality"
cat /tmp/quality-review.md 2>/dev/null || echo "No quality issues found."
} > /tmp/full-review.md
curl -s -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
-d "$(jq -Rs '{body: .}' < /tmp/full-review.md)" \
"https://gitea.tap-tap.win/api/v1/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
+1 -1
View File
@@ -2,7 +2,7 @@ name: CI
on: on:
push: push:
branches: [main] branches: [dev, main]
pull_request: pull_request:
jobs: jobs: