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
'body': `${quote}\n\n@${context.payload.comment.user.login}, unrecognized \`stdlib\` attribute value \`${stdlibTarget}\`. Valid values are \`public\` (opens issue on \`stdlib-js/stdlib\`) or \`private\` (opens issue on the internal todo repository).`
'body': `${quote}\n\n@${context.payload.comment.user.login}, failed to parse the todo title. The first line of the code block must be of the form \`[TODO]: Issue title\`.`
289
+
});
290
+
core.setFailed( 'No [TODO]: line found in the code block.' );
291
+
return;
292
+
}
293
+
294
+
const title = titleMatch[ 1 ].trim();
295
+
const body = contentLines.slice( 1 ).join( '\n' ).trim();
const provenance = `\n\n---\n*Created via \`/stdlib todo\` from [${context.repo.owner}/${context.repo.repo}#${context.issue.number}](${prUrl}) by @${context.payload.comment.user.login}.*`;
// Check for labels that were silently dropped (do not exist in the target repo):
347
+
const appliedLabels = issue.data.labels.map( l => l.name );
348
+
const droppedLabels = labels.filter( l => !appliedLabels.includes( l ) );
349
+
350
+
// Post a confirmation comment:
351
+
const confirmBody = droppedLabels.length > 0
352
+
? `@${context.payload.comment.user.login}, the following todo issue has been created: ${issue.data.html_url}\n\n> [!WARNING]\n> The following labels were not applied because they do not exist on \`${targetOwner}/${targetRepo}\`: ${droppedLabels.map( l => `\`${l}\`` ).join( ', ' )}.`
353
+
: `@${context.payload.comment.user.login}, the following todo issue has been created: ${issue.data.html_url}`;
354
+
await github.rest.issues.createComment({
355
+
'owner': context.repo.owner,
356
+
'repo': context.repo.repo,
357
+
'issue_number': context.issue.number,
358
+
'body': confirmBody
359
+
});
360
+
209
361
# Define a job for printing a list of available slash commands:
210
362
help:
211
363
@@ -241,6 +393,7 @@ jobs:
241
393
- `/stdlib lint-autofix` - Auto-fix lint errors.
242
394
- `/stdlib merge` - Merge changes from develop branch into this PR.
243
395
- `/stdlib rebase` - Rebase this PR on top of develop branch.
396
+
- `/stdlib todo` - Create a new todo issue.
244
397
245
398
# GitHub token:
246
399
token: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
@@ -255,7 +408,7 @@ jobs:
255
408
runs-on: ubuntu-latest
256
409
257
410
# Ensure all previous jobs have completed before running this job:
0 commit comments