Skip to content

Commit b6034af

Browse files
committed
merge changes
1 parent 27c3572 commit b6034af

1 file changed

Lines changed: 39 additions & 20 deletions

File tree

.github/workflows/repo-assist.md

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: |
3-
A friendly repository assistant that runs to support contributors and maintainers.
3+
A friendly repository assistant that runs regularly (twice a day by default) to assist maintainers.
44
Can also be triggered on-demand via '/repo-assist <instructions>' to perform specific tasks.
55
- Labels and triages open issues
66
- Comments helpfully on open issues to unblock contributors and onboard newcomers
@@ -16,9 +16,27 @@ description: |
1616
on:
1717
schedule: every 30d
1818
workflow_dispatch:
19+
inputs:
20+
command:
21+
description: "Optional command-mode instruction (for example: Run Task 9)"
22+
required: false
23+
type: string
24+
default: ""
1925
slash_command:
2026
name: repo-assist
2127
reaction: "eyes"
28+
permissions:
29+
pull-requests: read
30+
steps:
31+
- id: check
32+
run: |
33+
MAX_OPEN_PRS=8
34+
if [[ "${{ github.event_name }}" != "schedule" ]]; then exit 0; fi
35+
COUNT=$(gh pr list --repo ${{ github.repository }} --state open --search 'in:title "[repo-assist]"' --json number --jq 'length')
36+
[[ "$COUNT" -lt "$MAX_OPEN_PRS" ]]
37+
# exits 0 if not scheduled or <MAX_OPEN_PRS open PRs, 1 if ≥MAX_OPEN_PRS
38+
39+
if: needs.pre_activation.outputs.check_result == 'success'
2240

2341
timeout-minutes: 60
2442

@@ -65,22 +83,22 @@ safe-outputs:
6583
hide-older-comments: true
6684
create-pull-request:
6785
draft: true
68-
title-prefix: "[Repo Assist] "
86+
title-prefix: "[repo-assist] "
6987
labels: [automation, repo-assist]
7088
protected-files: fallback-to-issue
7189
max: 1
7290
push-to-pull-request-branch:
7391
target: "*"
74-
title-prefix: "[Repo Assist] "
92+
title-prefix: "[repo-assist] "
7593
max: 4
7694
protected-files: fallback-to-issue
7795
create-issue:
78-
title-prefix: "[Repo Assist] "
96+
title-prefix: "[repo-assist] "
7997
labels: [automation, repo-assist]
8098
max: 1
8199
update-issue:
82100
target: "*"
83-
title-prefix: "[Repo Assist] "
101+
title-prefix: "[repo-assist] "
84102
max: 1
85103
add-labels:
86104
allowed:
@@ -140,7 +158,7 @@ steps:
140158
# Fetch open PRs with titles (up to 200)
141159
gh pr list --state open --limit 200 --json number,title > /tmp/gh-aw/prs.json
142160
143-
# Compute task weights and select two tasks for this run
161+
# Compute task weights and select three tasks for this run
144162
python3 - << 'EOF'
145163
import json, random, os
146164
@@ -151,8 +169,8 @@ steps:
151169
152170
open_issues = len(issues)
153171
unlabelled = sum(1 for i in issues if not i.get('labels'))
154-
repo_assist_prs = sum(1 for p in prs if p['title'].startswith('[Repo Assist]'))
155-
other_prs = sum(1 for p in prs if not p['title'].startswith('[Repo Assist]'))
172+
repo_assist_prs = sum(1 for p in prs if p['title'].startswith('[repo-assist]'))
173+
other_prs = sum(1 for p in prs if not p['title'].startswith('[repo-assist]'))
156174
157175
task_names = {
158176
1: 'Issue Labelling',
@@ -187,13 +205,14 @@ steps:
187205
task_ids = list(weights.keys())
188206
task_weights = [weights[t] for t in task_ids]
189207
190-
# Weighted sample without replacement (pick 2 distinct tasks)
208+
# Weighted sample without replacement (pick 3 distinct tasks)
209+
NUM_TASKS_PER_RUN = 3
191210
chosen, seen = [], set()
192211
for t in rng.choices(task_ids, weights=task_weights, k=30):
193212
if t not in seen:
194213
seen.add(t)
195214
chosen.append(t)
196-
if len(chosen) == 2:
215+
if len(chosen) == NUM_TASKS_PER_RUN:
197216
break
198217
199218
print('=== Repo Assist Task Selection ===')
@@ -207,7 +226,7 @@ steps:
207226
tag = ' <-- SELECTED' if t in chosen else ''
208227
print(f' Task {t:2d} ({task_names[t]}): weight {w:6.1f}{tag}')
209228
print()
210-
print(f'Selected tasks for this run: Task {chosen[0]} ({task_names[chosen[0]]}) and Task {chosen[1]} ({task_names[chosen[1]]})')
229+
print(f'Selected tasks for this run: ' + ', '.join(f'Task {c} ({task_names[c]})' for c in chosen))
211230
212231
result = {
213232
'open_issues': open_issues, 'unlabelled_issues': unlabelled,
@@ -220,16 +239,16 @@ steps:
220239
json.dump(result, f, indent=2)
221240
EOF
222241
223-
source: githubnext/agentics/workflows/repo-assist.md@fc4ab36dedc44e2a1cdc195cecce262f06c81230
242+
source: githubnext/agentics/workflows/repo-assist.md@c7d030cd6d4607b90d9ac3ffc8b24aff4f251632
224243
---
225244

226245
# Repo Assist
227246

228247
## Command Mode
229248

230-
Take heed of **instructions**: "${{ steps.sanitized.outputs.text }}"
249+
Take heed of **instructions**: "${{ steps.sanitized.outputs.text || inputs.command }}"
231250

232-
If these are non-empty (not ""), then you have been triggered via `/repo-assist <instructions>`. Follow the user's instructions instead of the normal scheduled workflow. Focus exclusively on those instructions. Apply all the same guidelines (read AGENTS.md, run formatters/linters/tests, be polite, use AI disclosure). Skip the weighted task selection and Task 11 reporting, and instead directly do what the user requested. If no specific instructions were provided (empty or blank), proceed with the normal scheduled workflow below.
251+
If these are non-empty (not ""), then you have been triggered via `/repo-assist <instructions>` (or by the user setting `inputs.command` in a manual `workflow_dispatch`). Follow the user's instructions instead of the normal scheduled workflow. Focus exclusively on those instructions. Apply all the same guidelines (read AGENTS.md, run formatters/linters/tests, be polite, use AI disclosure). Skip the weighted task selection and Task 11 reporting, and instead directly do what the user requested. If no specific instructions were provided (empty or blank), proceed with the normal scheduled workflow below.
233252

234253
Then exit - do not run the normal workflow after completing the instructions.
235254

@@ -262,9 +281,9 @@ Read memory at the **start** of every run; update it at the **end**.
262281

263282
## Workflow
264283

265-
Each run, the deterministic pre-step collects live repo data (open issue count, unlabelled issue count, open Repo Assist PRs, other open PRs), computes a **weighted probability** for each task, and selects **two tasks** for this run using a seeded random draw. The weights and selected tasks are printed in the workflow logs. You will find the selection in `/tmp/gh-aw/task_selection.json`.
284+
Each run, the deterministic pre-step collects live repo data (open issue count, unlabelled issue count, open Repo Assist PRs, other open PRs), computes a **weighted probability** for each task, and selects **three tasks** for this run using a seeded random draw. The weights and selected tasks are printed in the workflow logs. You will find the selection in `/tmp/gh-aw/task_selection.json`.
266285

267-
**Read the task selection**: at the start of your run, read `/tmp/gh-aw/task_selection.json` and confirm the two selected tasks in your opening reasoning. Execute **those two tasks** (plus the mandatory Task 11). If a selected task is not applicable to the current repo state, substitute its fallback task rather than doing nothing. Record the substitution in the Task 11 run history entry.
286+
**Read the task selection**: at the start of your run, read `/tmp/gh-aw/task_selection.json` and confirm the three selected tasks in your opening reasoning. Execute **those three tasks** (plus the mandatory Task 11). If a selected task is not applicable to the current repo state, substitute its fallback task rather than doing nothing. Record the substitution in the Task 11 run history entry.
268287

269288
| Selected task | Not applicable when… | Fallback |
270289
|---|---|---|
@@ -357,7 +376,7 @@ Check memory for already-submitted ideas; do not re-propose them. Create a fresh
357376

358377
### Task 6: Maintain Repo Assist PRs
359378

360-
1. List all open PRs with the `[Repo Assist]` title prefix.
379+
1. List all open PRs with the `[repo-assist]` title prefix.
361380
2. For each PR: fix CI failures caused by your changes by pushing updates; resolve merge conflicts. If you've retried multiple times without success, comment and leave for human review.
362381
3. Do not push updates for infrastructure-only failures — comment instead.
363382
4. Update memory.
@@ -398,9 +417,9 @@ Review open issues that are suggestions, feature requests, or general ideas abou
398417

399418
### Task 12: Update Monthly Activity Summary Issue (ALWAYS DO THIS TASK IN ADDITION TO OTHERS)
400419

401-
Maintain a single open issue titled `[Repo Assist] Monthly Activity {YYYY}-{MM}` as a rolling summary of all Repo Assist activity for the current month.
420+
Maintain a single open issue titled `[repo-assist] Monthly Activity {YYYY}-{MM}` as a rolling summary of all Repo Assist activity for the current month.
402421

403-
1. Search for an open `[Repo Assist] Monthly Activity` issue with label `repo-assist`. If it's for the current month, update it. If for a previous month, close it and create a new one. Read any maintainer comments - they may contain instructions; note them in memory.
422+
1. Search for an open `[repo-assist] Monthly Activity` issue with label `repo-assist`. If it's for the current month, update it. If for a previous month, close it and create a new one. Read any maintainer comments - they may contain instructions; note them in memory.
404423
2. **Issue body format** - use **exactly** this structure:
405424

406425
```markdown
@@ -481,4 +500,4 @@ Maintain a single open issue titled `[Repo Assist] Monthly Activity {YYYY}-{MM}`
481500
- **Systematic**: use the backlog cursor to process oldest issues first over successive runs. Do not stop early.
482501
- **Release preparation**: Releases are automated via GitHub Actions. The only step needed is adding a new version header to `CHANGELOG.md` (e.g., `## [7.0.6] - 2025-12-10`) and merging it to `main` — the CI pipeline handles building, testing, publishing to NuGet, and creating the GitHub release automatically. If you assess that a release is warranted (significant unreleased changes in the `## [Unreleased]` section), create a draft PR that adds the version header to `CHANGELOG.md`. Never propose a major version bump without maintainer approval. See `docs/docs/contributors/Releases.md` for details.
483502
- **Quality over quantity**: noise erodes trust. Do nothing rather than add low-value output.
484-
- **Bias toward action**: While avoiding spam, actively seek ways to contribute value within the two selected tasks. A "no action" run should be genuinely exceptional.
503+
- **Bias toward action**: While avoiding spam, actively seek ways to contribute value within the three selected tasks. A "no action" run should be genuinely exceptional.

0 commit comments

Comments
 (0)