diff --git a/.github/workflows/isssue-assigned.yml b/.github/workflows/isssue-assigned.yml deleted file mode 100644 index 35e2ef21..00000000 --- a/.github/workflows/isssue-assigned.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Issue Assignment Comment - -on: - issues: - types: [assigned] - -jobs: - issue-assignment-comment: - runs-on: ubuntu-latest - - steps: - - name: Issue assignment comment - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const assignee = `@${context.payload.issue.assignees[0].login}`; - - const commentBody = `Hey ${assignee}! Thanks for taking this issue. - - To help keep everyone in the loop, please comment your Estimated Time to Completion (ETC) below! - - Thanks again! - `; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: commentBody, - }); diff --git a/.github/workflows/issue-assigned.yml b/.github/workflows/issue-assigned.yml new file mode 100644 index 00000000..72ecf7d9 --- /dev/null +++ b/.github/workflows/issue-assigned.yml @@ -0,0 +1,35 @@ +name: Issue Assignment Comment + +on: + issues: + types: [assigned] + +jobs: + issue-assignment-comment: + runs-on: ubuntu-latest + + steps: + - name: Issue assignment comment + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const assignees = context.payload.issue.assignees; + + for (const assignee of assignees) { + const assigneeUsername = `@${assignee.login}`; + + const commentBody = `Hey ${assigneeUsername}! Thanks for taking this issue. + + To help keep everyone in the loop, please comment your Estimated Time to Completion (ETC) below! + + Thanks again! + `; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: commentBody, + }); + }