Skip to content

Commit 12cb4a0

Browse files
committed
Enhancement: Synchronize with ergebnis/php-cs-fixer-config-template
1 parent 1635e51 commit 12cb4a0

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

.github/workflows/triage.yaml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: "Triage"
44

55
on: # yamllint disable-line rule:truthy
6-
pull_request:
6+
pull_request_target:
77
types:
88
- "opened"
99

@@ -13,33 +13,10 @@ jobs:
1313

1414
runs-on: "ubuntu-latest"
1515

16+
timeout-minutes: 5
17+
1618
steps:
1719
- 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"
1921
with:
2022
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-
}

0 commit comments

Comments
 (0)