Skip to content

Commit 6ecb386

Browse files
feat: add Fro Bot agent workflow (#70)
* feat: add Fro Bot agent workflow - Introduced a new GitHub Actions workflow for the Fro Bot. - Configured triggers for issue comments, pull requests, and scheduled audits. - Included prompts for manual and scheduled runs to guide the bot's actions. * fix: correct PROMPT variable syntax * chore(deps): update github/codeql-action action to v4.32.3 (#71) Co-authored-by: mrbro-bot[bot] <137683033+mrbro-bot[bot]@users.noreply.github.com> * ci(fro-bot): add PR review comment trigger and 15-min job timeout * ci(fro-bot): tighten triggers, prompts, and fork handling * ci(fro-bot): update agent version to HEAD to get past model issue --------- Co-authored-by: mrbro-bot[bot] <137683033+mrbro-bot[bot]@users.noreply.github.com>
1 parent 42970ac commit 6ecb386

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

.github/settings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ branches:
1616
[
1717
Build,
1818
Docs Build,
19+
Fro Bot,
1920
Typecheck,
2021
Lint,
2122
Test,

.github/workflows/fro-bot.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: Fro Bot
3+
4+
on:
5+
issue_comment:
6+
types: [created]
7+
pull_request_review_comment:
8+
types: [created]
9+
pull_request:
10+
branches: [main]
11+
types: [opened, synchronize, reopened, ready_for_review]
12+
schedule:
13+
- cron: '0 0 * * *'
14+
workflow_dispatch:
15+
inputs:
16+
prompt:
17+
description: Custom prompt for the Fro Bot agent
18+
required: false
19+
20+
permissions:
21+
contents: read
22+
23+
concurrency:
24+
group: fro-bot-${{ github.event.issue.number || github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: true
26+
27+
env:
28+
DEFAULT_PROMPT: |
29+
You are Fro Bot, an AI assistant for managing GitHub repositories. Your tasks include:
30+
- Reviewing new issues and pull requests
31+
- Providing feedback and suggestions
32+
- Triaging and labeling issues
33+
- Assisting with code reviews
34+
- Engaging with the community to keep the repository healthy and active
35+
You have been triggered by a recent event. Please analyze the context and take appropriate actions to help maintain the repository.
36+
SCHEDULE_PROMPT: |
37+
Review the repository's open issues and pull requests. For each item, determine if it is:
38+
- Stale and needs follow-up
39+
- Ready for review
40+
- Needs triage
41+
Summarize your findings in a comment on the issue or PR, or create a new issue if necessary.
42+
43+
jobs:
44+
fro-bot:
45+
if: >-
46+
(
47+
github.event.pull_request == null ||
48+
!github.event.pull_request.head.repo.fork
49+
) &&
50+
(
51+
(github.event_name != 'issue_comment' && github.event_name != 'pull_request_review_comment') ||
52+
(
53+
contains(github.event.comment.body || '', '@fro-bot') &&
54+
(github.event.comment.user.login || '') != 'fro-bot' &&
55+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association || '')
56+
)
57+
)
58+
name: Fro Bot
59+
runs-on: ubuntu-latest
60+
timeout-minutes: 15
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
64+
with:
65+
fetch-depth: 0
66+
token: ${{ secrets.FRO_BOT_PAT }}
67+
68+
- name: Setup Bun
69+
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2.1.2
70+
71+
- name: Install dependencies
72+
run: bun install --frozen-lockfile
73+
74+
- name: Run Fro Bot
75+
uses: fro-bot/agent@929db5028efcda98199303941e9edd6c54075980
76+
env:
77+
OPENCODE_PROMPT_ARTIFACT: 'true'
78+
PROMPT: ${{ (github.event_name == 'workflow_dispatch' && (github.event.inputs.prompt || env.DEFAULT_PROMPT)) || (github.event_name == 'schedule' && env.SCHEDULE_PROMPT) || '' }}
79+
with:
80+
auth-json: '{}'
81+
github-token: ${{ secrets.FRO_BOT_PAT }}
82+
prompt: ${{ env.PROMPT }}

0 commit comments

Comments
 (0)