-
Notifications
You must be signed in to change notification settings - Fork 6
executable file
·37 lines (33 loc) · 1.02 KB
/
issue.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
36
37
name: Test If Issue is an adaptation request
on:
issues:
types:
- opened
- reopened
jobs:
extract_label:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Extract Label and Title
uses: actions/github-script@v6
with:
script: |
const issueTitle = context.payload.issue.title;
const regexResult = issueTitle.match(/\[(.*?)\]\[(.*?)\](.*)/);
if (regexResult && regexResult.length >= 4) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [regexResult[2]]
});
github.rest.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
title: "适配请求:"+regexResult[3]
});
} else {
}