forked from zilliztech/VectorDBBench
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (32 loc) · 1.04 KB
/
keep_open_command.yml
File metadata and controls
38 lines (32 loc) · 1.04 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
name: Keep Open Command
on:
issue_comment:
types: [created]
jobs:
keep-open:
if: >-
!github.event.issue.pull_request
&& contains(github.event.comment.body, '/keep-open')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v7
with:
script: |
const TEAM_ASSOCIATIONS = ['MEMBER', 'OWNER'];
const association = context.payload.comment.author_association;
if (!TEAM_ASSOCIATIONS.includes(association)) {
console.log(`Ignoring /keep-open from non-team user (association: ${association})`);
return;
}
const owner = context.repo.owner;
const repo = context.repo.repo;
const issue_number = context.issue.number;
await github.rest.issues.addLabels({
owner,
repo,
issue_number,
labels: ['keep-open'],
});
console.log(`Added 'keep-open' label to #${issue_number}`);