regd-testing 0.1.2

regd testing is a collection of utilities designed to simplify testing in regd projects.
Documentation
name: Auto Assign on 'take' Comment
on:
  issue_comment:
    types: [created]
permissions:
  issues: write
jobs:
  assign:
    runs-on: ubuntu-latest
    if: (!github.event.issue.pull_request) && github.event.comment.body == 'take'
    concurrency:
      group: ${{ github.actor }}-auto-assign-issue
      cancel-in-progress: true
    steps:
      - name: Auto assign if comment includes 'take'
        uses: actions/github-script@v7
        with:
          script: |
            const body = context.payload.comment.body.trim().toLowerCase();
            const author = context.payload.comment.user.login;
            const issue = context.payload.issue;
            if (body !== 'take') {
              console.log("Comment is not exactly 'take'; skipping.");
              return;
            }
            const alreadyAssigned = issue.assignees.find(a => a.login === author);
            if (alreadyAssigned) {
              console.log(`${author} is already assigned; skipping.`);
              return;
            }
            if (issue.assignees.length > 0) {
              console.log("Issue already has an assignee; skipping assignment.");
              return;
            }
            await github.rest.issues.addAssignees({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: issue.number,
              assignees: [author],
            });
            console.log(`Assigned ${author} to issue #${issue.number}`);