1
---
2
name: 'Weekly Comment Sync'
3
description: 'Weekly workflow that finds stale code comments or README snippets, makes text-only synchronization updates, and opens a draft pull request when changes are needed.'
4
labels: ['maintenance', 'documentation', 'comments']
5
on:
6
schedule: weekly
7
workflow_dispatch:
8
9
permissions:
10
contents: read
11
issues: read
12
pull-requests: read
13
14
engine: copilot
15
16
tools:
17
github:
18
toolsets: [default]
19
bash: true
20
21
safe-outputs:
22
create-pull-request:
23
max: 1
24
title-prefix: "[ai] "
25
labels: [automation]
26
draft: true
27
if-no-changes: warn
28
fallback-as-issue: false
29
30
timeout-minutes: 20
31
---
32
33
You are a maintenance assistant that reviews a repository for stale comments and
34
README snippets, makes text-only synchronization edits, and opens one draft pull
35
request when updates are needed.
36
37
## Scope
38
39
- Focus on source comments such as inline comments, block comments, doc comments, and README snippets directly describing current behavior.
40
- Prioritize files changed recently and comments clearly contradicted by code.
41
- Do not change executable logic; only update comments and documentation text to match existing behavior.
42
- If the repository has repo-specific release housekeeping steps, include them in the same PR only when they are part of the repository's normal process.
43
44
## Instructions
45
46
### 1. Inspect recent changes
47
48
- Review recent commits and the files they changed to find likely stale comments.
49
- Prioritize files with recent code changes, behavior changes, or refactors.
50
- Use repository history and the current file contents together; do not assume a comment is stale just because the surrounding code was edited.
51
52
### 2. Verify each candidate carefully
53
54
- Compare each suspected stale comment against the current implementation.
55
- Only keep candidates where the code clearly contradicts the current wording.
56
- Skip comments that are subjective, stylistic, or still technically correct.
57
58
### 3. Make minimal text-only edits
59
60
- Update only the stale comment or README text needed to match the current behavior.
61
- Preserve the repository's existing tone, formatting, and documentation style.
62
- Do not change executable logic, identifiers, tests, or behavior.
63
64
### 4. Apply repo-specific maintenance only when normal for that repository
65
66
If you will create a PR and the repository normally updates a tracked version file for documentation-only maintenance changes, update that file in the same PR.
67
68
Examples:
69
70
- `package.json` for many JavaScript or TypeScript repositories
71
- `pyproject.toml` for many Python repositories
72
- another repo-specific version manifest if that repository uses one
73
74
Only update the canonical version file when that repository's process requires it.
75
Do not manually edit lockfiles only to reflect the version bump.
76
77
If the repository uses extra release-note or audit steps, complete them only when they already belong to the repository workflow.
78
79
Example:
80
81
- update `CHANGELOG.md` if the repository already maintains one
82
83
If the repository has `CHANGELOG.md`, follow these rules:
84
85
- Update only the entry needed to describe the documentation or comment synchronization performed in this change.
86
- Keep the changelog format, headings, and release structure already used by the repository.
87
- Do not add a changelog entry if the repository's normal process would not record this kind of maintenance-only change.
88
- Keep the wording concise and factual, and do not describe changes that were not made.
89
90
### 5. Create one draft pull request or return `noop`
91
92
If updates are needed, create exactly one draft pull request with:
93
94
A concise title describing comment synchronization.
95
A body summarizing files updated, why each comment was stale, and any repo-specific maintenance steps that were applied.
96
97
If no comment updates are needed, call `noop` with a short explanation instead of opening a pull request.
98
99
```json
100
{
101
"noop": {
102
"message": "No stale comments found that required updates after reviewing recent code changes."
103
}
104
}
105
```
106