forked from microsoft/mssql-python
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 2.48 KB
/
issue-acknowledge.yml
File metadata and controls
68 lines (60 loc) · 2.48 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Auto Acknowledge GH Issues
on:
issues:
types: [opened]
permissions:
contents: read
issues: write
jobs:
acknowledge:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
# Step 1: Wait 15 minutes
- name: Wait 15 minutes
run: sleep 900
# Step 2: Check if a maintainer already responded
- name: Check for existing maintainer response
id: check
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const maintainers = ['sumitmsft','dlevy-msft-sql','gargsaumya','bewithgaurav','subrata-ms','jahnvi480','saurabh500'];
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number
});
const maintainerReplied = comments.data.some(
comment => maintainers.includes(comment.user.login)
);
core.setOutput('skip', maintainerReplied.toString());
console.log(`Maintainer already replied: ${maintainerReplied}`);
# Step 3: Post acknowledgement ONLY if no maintainer has responded
- name: Post acknowledgement comment
if: steps.check.outputs.skip == 'false'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
body: `Hi @${context.payload.issue.user.login}, thank you for opening this issue!\n\nOur team will review it shortly. We aim to triage all new issues within 24-48 hours and get back to you.\n\nIf you have additional information to share, please feel free to update the issue.\n\nThank you for your patience!`
});
# Step 4: Add "triage needed" label if no maintainer has responded
- name: Add triage needed label
if: steps.check.outputs.skip == 'false'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['triage needed']
});