Skip to content

Commit 93ac520

Browse files
stevesCopilot
andauthored
Update the prompt in the redirects issue (#61142)
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 00280e1 commit 93ac520

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ jobs:
126126
}
127127
128128
const report = JSON.parse(fs.readFileSync(reportFile, 'utf8'))
129-
const redirectGroups = report.groups.filter(g => g.isWarning).slice(0, 5)
129+
const allRedirectGroups = report.groups.filter(g => g.isWarning)
130+
const redirectGroups = allRedirectGroups.slice(0, 5)
130131
131132
if (redirectGroups.length === 0) {
132133
core.info('No redirect groups found, skipping Copilot issue.')
@@ -141,11 +142,17 @@ jobs:
141142
return `| \`${g.target}\` | \`${redirectTarget}\` | \`${file}\` | ${lines} |`
142143
}).join('\n')
143144
145+
const actionRunUrl = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
146+
const hasMore = allRedirectGroups.length > redirectGroups.length
147+
const countLine = hasMore
148+
? `These are the first ${redirectGroups.length} of ${allRedirectGroups.length} redirects found. The full list is available in the [workflow run artifacts](${actionRunUrl}).`
149+
: `These are the first ${redirectGroups.length} of ${allRedirectGroups.length} redirects found.`
150+
144151
const body = [
145-
'@copilot Please fix the redirected internal links listed in the table below.',
146-
'All changes should be made within the `github/docs-internal` repository.',
147-
'For each entry, open the source file and replace the **Current Link** with the **Update To** path.',
148-
'When all changes are made, open a pull request in `github/docs-internal` with the fixes.',
152+
'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.',
153+
'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.',
154+
'',
155+
countLine,
149156
'',
150157
'## Redirects to fix',
151158
'',
@@ -166,7 +173,7 @@ jobs:
166173
agent_assignment: {
167174
target_repo: 'github/docs-internal',
168175
base_branch: 'main',
169-
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.',
176+
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. 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.',
170177
},
171178
})
172179

0 commit comments

Comments
 (0)