Skip to content

feat: add Secrets Manager browser (M3.9) #6

feat: add Secrets Manager browser (M3.9)

feat: add Secrets Manager browser (M3.9) #6

Workflow file for this run

name: unic-bot
on:
issue_comment:
types: [created]
jobs:
handle-command:
if: contains(github.event.comment.body, '@unic-bot')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Handle bot command
uses: actions/github-script@v7
with:
script: |
const body = context.payload.comment.body;
const commenter = context.payload.comment.user.login;
const issue = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
// Extract command after "@unic-bot:"
const match = body.match(/@unic-bot:\s*(.+)/i);
if (!match) {
await github.rest.issues.createComment({
owner, repo, issue_number: issue,
body: `@${commenter} I didn't understand that. Usage: \`@unic-bot: <command>\`\n\nAvailable commands:\n- \`assign me\` — assign this issue to yourself`,
});
return;
}
const command = match[1].trim().toLowerCase();
if (command === 'assign me') {
await github.rest.issues.addAssignees({
owner, repo, issue_number: issue,
assignees: [commenter],
});
await github.rest.issues.createComment({
owner, repo, issue_number: issue,
body: `@${commenter} has been assigned to this issue.`,
});
} else {
await github.rest.issues.createComment({
owner, repo, issue_number: issue,
body: `@${commenter} Unknown command: \`${command}\`\n\nAvailable commands:\n- \`assign me\` — assign this issue to yourself`,
});
}