File tree Expand file tree Collapse file tree 1 file changed +4
-27
lines changed Expand file tree Collapse file tree 1 file changed +4
-27
lines changed Original file line number Diff line number Diff line change 3
3
name : " Triage"
4
4
5
5
on : # yamllint disable-line rule:truthy
6
- pull_request :
6
+ pull_request_target :
7
7
types :
8
8
- " opened"
9
9
@@ -13,33 +13,10 @@ jobs:
13
13
14
14
runs-on : " ubuntu-latest"
15
15
16
+ timeout-minutes : 5
17
+
16
18
steps :
17
19
- name : " Add labels based on branch name"
18
- uses : " actions/github-script@v2 "
20
+ uses : " ergebnis/.github/ actions/github/pull-request/add-label-based-on-branch-name@1.9.2 "
19
21
with :
20
22
github-token : " ${{ secrets.ERGEBNIS_BOT_TOKEN }}"
21
- script : |
22
- const branchPrefixLabels = {
23
- feature: "enhancement",
24
- fix: "bug",
25
- }
26
-
27
- const pullRequest = context.payload.pull_request
28
- const repository = context.repo
29
-
30
- const branchName = pullRequest.head.ref
31
-
32
- const matches = branchName.match(new RegExp('^([^/]+)\/'));
33
-
34
- if (matches instanceof Array && branchPrefixLabels.hasOwnProperty(matches[1])) {
35
- const label = branchPrefixLabels[matches[1]]
36
-
37
- github.issues.addLabels({
38
- issue_number: pullRequest.number,
39
- labels: [
40
- label
41
- ],
42
- owner: repository.owner,
43
- repo: repository.repo,
44
- });
45
- }
You can’t perform that action at this time.
0 commit comments