Self-Onboarding Content: Melissa #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
}); | |
} |