Skip to content

Commit 862eab5

Browse files
stevesCopilotCopilot
authored
Improve Copilot redirect issue prompt to use directives instead of table (#61554)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: steves <54561+steves@users.noreply.github.com>
1 parent c228cdd commit 862eab5

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/link-check-internal.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,27 +134,28 @@ jobs:
134134
return
135135
}
136136
137-
const tableRows = redirectGroups.map(g => {
137+
const directives = redirectGroups.map(g => {
138138
const occ = g.occurrences[0]
139139
const redirectTarget = occ?.redirectTarget ?? 'unknown'
140140
const file = occ?.file ?? 'unknown'
141-
const lines = (occ?.lines ?? []).join(', ')
142-
return `| \`${g.target}\` | \`${redirectTarget}\` | \`${file}\` | ${lines} |`
141+
const lines = (occ?.lines ?? []).join(', ') || 'unknown'
142+
return `- Update \`${g.target}\` to \`${redirectTarget}\` in \`${file}\` (line(s): ${lines})`
143143
}).join('\n')
144144
145145
const artifactsUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}/artifacts`
146146
147147
const bodyLines = [
148-
'Copilot please fix the redirected internal links listed in the table below. All changes should be made within the `github/docs-internal` repository. For each entry, open the source file and replace the **Current Link** with the **Update To** path.',
148+
'Copilot, fix the redirected internal links listed below. All changes should be made within the `github/docs-internal` repository.',
149+
'',
150+
'For each directive below, open the specified file and find the old link path. Replace it with the new link path exactly as shown. Do not invent or guess link paths — only use the exact paths provided in each directive.',
151+
'',
149152
'When all changes are made, open a pull request in `github/docs-internal` with the fixes. The pull request description should reference this issue to create a link between them. When the pull request is open, leave a comment on this issue with a link to it.',
150153
'',
151154
`These are the first ${redirectGroups.length} of ${allRedirectGroups.length} redirects found.`,
152155
'',
153-
'## Redirects to fix',
156+
'## Redirects to update',
154157
'',
155-
'| Current Link | Update To | File | Line(s) |',
156-
'|---|---|---|---|',
157-
tableRows,
158+
directives,
158159
]
159160
160161
const MAX_ISSUE_BODY_LENGTH = 65536
@@ -179,7 +180,7 @@ jobs:
179180
agent_assignment: {
180181
target_repo: 'github/docs-internal',
181182
base_branch: 'main',
182-
custom_instructions: 'For each entry in the table, open the source file in the github/docs-internal repository and replace the Current Link with the Update To path. When all changes are made, open a pull request in github/docs-internal with the fixes. When the pull request is open, leave a comment on this issue with a link to it.',
183+
custom_instructions: 'Follow each directive in the issue exactly. Each directive specifies a file, the old link to find, and the new link to replace it with. Use only the exact paths provided — do not invent or guess any link paths. When all changes are made, open a pull request in github/docs-internal with the fixes. When the pull request is open, leave a comment on this issue with a link to it.',
183184
},
184185
})
185186

0 commit comments

Comments
 (0)