-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Synchronize with ergebnis/php-library-template
- Loading branch information
1 parent
0bc1dc2
commit 7496f88
Showing
6 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "Triage" | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request: null | ||
|
||
jobs: | ||
label: | ||
name: "Label" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Add labels based on branch name" | ||
if: "github.event.action == 'opened'" | ||
uses: "actions/[email protected]" | ||
with: | ||
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" | ||
script: | | ||
const branchPrefixLabels = { | ||
feature: "enhancement", | ||
fix: "bug", | ||
} | ||
const pullRequest = context.payload.pull_request | ||
const repository = context.repo | ||
const branchName = pullRequest.head.ref | ||
const matches = branchName.match(new RegExp('^([^/]+)\/')); | ||
if (matches instanceof Array && branchPrefixLabels.hasOwnProperty(matches[1])) { | ||
const label = branchPrefixLabels[matches[1]] | ||
github.issues.addLabels({ | ||
issue_number: pullRequest.number, | ||
labels: [ | ||
label | ||
], | ||
owner: repository.owner, | ||
repo: repository.repo, | ||
}); | ||
} |
Binary file not shown.