mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
feat: ci pr management
This commit is contained in:
@@ -6,7 +6,7 @@ runs:
|
||||
- name: Mount Bun Cache
|
||||
uses: useblacksmith/stickydisk@v1
|
||||
with:
|
||||
key: ${{ github.repository }}-bun-cache
|
||||
key: ${{ github.repository }}-bun-cache-${{ runner.os }}
|
||||
path: ~/.bun
|
||||
|
||||
- name: Setup Bun
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
name: "Setup Git Committer"
|
||||
description: "Create app token and configure git user"
|
||||
inputs:
|
||||
opencode-app-id:
|
||||
description: "OpenCode GitHub App ID"
|
||||
# kilocode_change start
|
||||
kilo-maintainer-app-id:
|
||||
description: "Kilo Maintainer GitHub App ID"
|
||||
required: true
|
||||
opencode-app-secret:
|
||||
description: "OpenCode GitHub App private key"
|
||||
kilo-maintainer-app-secret:
|
||||
description: "Kilo Maintainer GitHub App private key"
|
||||
required: true
|
||||
# kilocode_change end
|
||||
outputs:
|
||||
token:
|
||||
description: "GitHub App token"
|
||||
@@ -21,8 +23,10 @@ runs:
|
||||
id: apptoken
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ inputs.opencode-app-id }}
|
||||
private-key: ${{ inputs.opencode-app-secret }}
|
||||
# kilocode_change start
|
||||
app-id: ${{ inputs.kilo-maintainer-app-id }}
|
||||
private-key: ${{ inputs.kilo-maintainer-app-secret }}
|
||||
# kilocode_change end
|
||||
owner: ${{ github.repository_owner }}
|
||||
|
||||
- name: Configure git user
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# kilocode_change - new file
|
||||
name: "Setup Kilo"
|
||||
description: "Install Kilo CLI globally"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install Kilo CLI
|
||||
run: bun add -g @kilocode/cli
|
||||
shell: bash
|
||||
@@ -0,0 +1,36 @@
|
||||
name: Check Organization Member
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
username:
|
||||
required: true
|
||||
type: string
|
||||
outputs:
|
||||
is-member:
|
||||
description: Whether the user is an org member or kilo-maintainer bot
|
||||
value: ${{ jobs.check.outputs.is-member }}
|
||||
|
||||
jobs:
|
||||
check:
|
||||
# kilocode_change - new file
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
outputs:
|
||||
is-member: ${{ steps.check.outputs.is-member }}
|
||||
steps:
|
||||
- name: Check if author is org member or kilo-maintainer bot
|
||||
id: check
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
USERNAME: ${{ inputs.username }}
|
||||
run: |
|
||||
if [[ "$USERNAME" == "kilo-maintainer[bot]" ]]; then
|
||||
echo "is-member=true" >> "$GITHUB_OUTPUT"
|
||||
echo "User is kilo-maintainer bot"
|
||||
elif gh api orgs/Kilo-Org/members/"$USERNAME" --silent 2>/dev/null; then
|
||||
echo "is-member=true" >> "$GITHUB_OUTPUT"
|
||||
echo "User is an org member"
|
||||
else
|
||||
echo "is-member=false" >> "$GITHUB_OUTPUT"
|
||||
echo "User is not an org member"
|
||||
fi
|
||||
@@ -5,22 +5,16 @@ on:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
# kilocode_change start
|
||||
check-author:
|
||||
uses: ./.github/workflows/check-org-member.yml
|
||||
with:
|
||||
username: ${{ github.event.pull_request.user.login }}
|
||||
|
||||
check-duplicates:
|
||||
# kilocode_change start - disabled for kilo-cli fork (requires OpenCode API key and install)
|
||||
if: false
|
||||
needs: check-author
|
||||
if: needs.check-author.outputs.is-member == 'false'
|
||||
# kilocode_change end
|
||||
# Original condition with OpenCode maintainer allowlist:
|
||||
# if: |
|
||||
# github.event.pull_request.user.login != 'actions-user' &&
|
||||
# github.event.pull_request.user.login != 'opencode' &&
|
||||
# github.event.pull_request.user.login != 'rekram1-node' &&
|
||||
# github.event.pull_request.user.login != 'thdxr' &&
|
||||
# github.event.pull_request.user.login != 'kommander' &&
|
||||
# github.event.pull_request.user.login != 'jayair' &&
|
||||
# github.event.pull_request.user.login != 'fwang' &&
|
||||
# github.event.pull_request.user.login != 'adamdotdevin' &&
|
||||
# github.event.pull_request.user.login != 'iamdavidhill' &&
|
||||
# github.event.pull_request.user.login != 'opencode-agent[bot]'
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -37,8 +31,10 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Install opencode
|
||||
run: curl -fsSL https://opencode.ai/install | bash
|
||||
# kilocode_change start
|
||||
- name: Setup Kilo
|
||||
uses: ./.github/actions/setup-kilo
|
||||
# kilocode_change end
|
||||
|
||||
- name: Build prompt
|
||||
env:
|
||||
@@ -58,7 +54,10 @@ jobs:
|
||||
|
||||
- name: Check for duplicate PRs
|
||||
env:
|
||||
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
|
||||
# kilocode_change start
|
||||
KILO_API_KEY: ${{ secrets.KILO_API_KEY }}
|
||||
KILO_ORG_ID: ${{ secrets.KILO_ORG_ID }}
|
||||
# kilocode_change end
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
@@ -69,7 +68,7 @@ jobs:
|
||||
$COMMENT"
|
||||
|
||||
add-contributor-label:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404 # kilocode_change
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
|
||||
Reference in New Issue
Block a user