generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 17
35 lines (27 loc) · 987 Bytes
/
issue-assigned.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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,
});
}