You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/cloud-docs-automation.yml
+21-5Lines changed: 21 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -92,10 +92,11 @@ jobs:
92
92
import { readFileSync, appendFileSync } from "fs"
93
93
const a = JSON.parse(readFileSync("/tmp/analysis.json", "utf8"))
94
94
const prefix = "IMPORTANT: Only make file changes using the Write and Edit tools. Never use git commands to stage, commit, or push files.\n\nIMPORTANT: To load the writing-docs skill, use the Skill tool directly with skill='writing-docs'. Do NOT spawn a sub-agent or use the Task tool to load it.\n\n"
95
+
const suffix = "\n\n---\n\nIMPORTANT — final step: after applying all documentation changes, write these two files using the Write tool:\n\n1. /tmp/pr-title.txt — a single-line pull request title. It MUST start with \"docs: \", followed by a concise summary of what was changed, and MUST end with \" [automated]\". Keep it under 100 characters. Example: \"docs: document new environment variables page [automated]\"\n2. /tmp/pr-summary.md — a short summary (2-4 sentences, or a few bullet points) of what was updated. Plain markdown, no top-level heading.\n\nIf you made no documentation changes, do not create either file.\n"
const date = new Date().toISOString().split("T")[0]
141
+
const projectList = a.affectedProjects
142
+
.map((p) => `- **${p.project}**: ${p.reason}`)
143
+
.join("\n")
144
+
111
145
const prefix = "IMPORTANT: Only make file changes using the Write and Edit tools. Never use git commands to stage, commit, or push files.\n\nIMPORTANT: To load the writing-docs skill, use the Skill tool directly with skill='writing-docs'. Do NOT spawn a sub-agent or use the Task tool to load it.\n\n"
146
+
147
+
// Claude owns the whole PR description so its format stays consistent
148
+
// across runs instead of being appended to by this workflow.
149
+
const suffix = [
150
+
"",
151
+
"",
152
+
"---",
153
+
"",
154
+
"IMPORTANT — final step: update the pull request description.",
155
+
"",
156
+
"These documentation changes land on a long-lived pull request that is reused for every commit until the next release. Read the current description from /tmp/existing-pr-body.md with the Read tool (the file is empty if the pull request does not exist yet), then write the FULL updated description to /tmp/pr-body.md with the Write tool.",
157
+
"",
158
+
"Rules for the updated description:",
159
+
"- Keep the existing structure and formatting exactly as-is. Do not reformat, reorder, or rewrite entries that are already there.",
160
+
"- Never remove, merge, or shorten existing entries. The description only grows.",
161
+
"- Add exactly one new entry for this commit, after the existing entries, matching the format the existing entries already use.",
162
+
"- Your new entry must summarize the documentation changes you just made in 2-4 sentences or a few bullet points.",
163
+
"- Write the file even if the description ends up unchanged in structure.",
Copy file name to clipboardExpand all lines: .github/workflows/dx-triage-doc-fixes.yml
+38-3Lines changed: 38 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,15 @@ jobs:
128
128
DX-2591
129
129
DX-2593
130
130
131
+
## Step 5 — Write the PR title and summary
132
+
133
+
After applying all fixes, write these two files using the Write tool:
134
+
135
+
1. /tmp/pr-title.txt — a single-line pull request title. It MUST start with "docs: ", followed by a concise summary of what was changed, and MUST end with " [automated]". Keep it under 100 characters. Example: "docs: fix incorrect subscriber examples and payment provider setup [automated]"
136
+
2. /tmp/pr-summary.md — a short summary (2-4 sentences, or a few bullet points) of what was updated. Plain markdown, no top-level heading.
137
+
138
+
If no issues qualified or were fixed, do not create either file.
139
+
131
140
- name: Stage documentation changes
132
141
id: changes
133
142
run: |
@@ -151,6 +160,21 @@ jobs:
151
160
echo "No issues fixed."
152
161
fi
153
162
163
+
- name: Read Claude-generated PR metadata
164
+
id: pr-meta
165
+
if: steps.changes.outputs.has_changes == 'true'
166
+
run: |
167
+
TITLE=""
168
+
if [ -s /tmp/pr-title.txt ]; then
169
+
TITLE=$(head -n 1 /tmp/pr-title.txt | sed 's/[[:space:]]*$//')
170
+
fi
171
+
# Fall back to a static title if Claude's title is missing or malformed
172
+
case "$TITLE" in
173
+
"docs: "*"[automated]") ;;
174
+
*) TITLE="docs: fix documentation issues in triage inbox [automated]" ;;
175
+
esac
176
+
echo "title=$TITLE" >> "$GITHUB_OUTPUT"
177
+
154
178
- name: Commit documentation changes
155
179
if: steps.changes.outputs.has_changes == 'true'
156
180
run: |
@@ -167,6 +191,7 @@ jobs:
167
191
REPO: ${{ github.repository }}
168
192
BRANCH: ${{ steps.branch.outputs.name }}
169
193
FIXED_IDS: ${{ steps.fixed-ids.outputs.ids }}
194
+
PR_TITLE: ${{ steps.pr-meta.outputs.title }}
170
195
run: |
171
196
BODY_FILE=$(mktemp)
172
197
@@ -175,6 +200,16 @@ jobs:
175
200
176
201
This PR fixes documentation issues from the triage inbox.
177
202
Each issue was evaluated by Claude and deemed a self-contained doc fix.
203
+
BODY_EOF
204
+
205
+
echo "" >> "$BODY_FILE"
206
+
if [ -s /tmp/pr-summary.md ]; then
207
+
cat /tmp/pr-summary.md >> "$BODY_FILE"
208
+
else
209
+
echo "_No summary was generated._" >> "$BODY_FILE"
210
+
fi
211
+
212
+
cat >> "$BODY_FILE" << 'BODY_EOF'
178
213
179
214
> Review carefully before merging. Claude may have missed context or made
180
215
> incorrect assumptions.
@@ -192,19 +227,19 @@ jobs:
192
227
if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ]; then
193
228
gh api "repos/$REPO/pulls/$PR_NUMBER" \
194
229
--method PATCH \
195
-
--field title="docs: fix documentation issues in triage inbox" \
230
+
--field title="$PR_TITLE" \
196
231
--field body="$(cat "$BODY_FILE")"
197
232
echo "Updated PR #$PR_NUMBER"
198
233
else
199
234
PR_NUMBER=$(gh api "repos/$REPO/pulls" \
200
235
--method POST \
201
-
--field title="docs: fix documentation issues in triage inbox" \
0 commit comments