-
Notifications
You must be signed in to change notification settings - Fork 322
38 lines (32 loc) · 1.19 KB
/
issue_thank.yaml
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
36
37
38
name: Auto Assign and Thank Issues
on:
issues:
types:
- opened
jobs:
auto-assign:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: 'Thank and assign the issue to the creator'
uses: actions/github-script@v7 # Updated to v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # Use auto-generated GitHub Token
script: |
const issueNumber = context.issue.number;
const issueCreator = context.payload.issue.user.login;
// Thank the issue creator
await github.rest.issues.createComment({
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Thanks @${issueCreator} for raising this issue! We'll look into it.We hope you have made sure that a similar issue doesnt exist , if it does, kindly ask to be assigned on that issue `
});
// Assign the issue to the creator
//await github.rest.issues.addAssignees({
// issue_number: issueNumber,
// owner: context.repo.owner,
// repo: context.repo.repo,
// assignees: [issueCreator]
// });