add github-actions

Signed-off-by: Christian Kotzbauer <christian.kotzbauer@gmail.com>
This commit is contained in:
Christian Kotzbauer 2020-09-11 16:35:44 +02:00
parent 5c20089278
commit 39cbf0a78d
8 changed files with 128 additions and 37 deletions

16
.github/label-commands.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
"commands": [
{ "command": "approved", "arg": "", "action": "add-label", "label": "approved", "dispatch": "approved" },
{ "command": "approved", "arg": "cancel", "action": "remove-label", "label": "approved" },
{ "command": "hold", "arg": "", "action": "add-label", "label": "hold" },
{ "command": "hold", "arg": "cancel", "action": "remove-label", "label": "hold" },
{ "command": "label", "arg": "(.*)", "action": "add-label", "label": "$1" },
{ "command": "remove-label", "arg": "(.*)", "action": "remove-label", "label": "$1" },
{ "command": "kind", "arg": "(bug|feature|documentation|test|cleanup)", "action": "add-label", "label": "kind/$1" },
{ "command": "lifecycle", "arg": "(stale|frozen)", "action": "add-label", "label": "lifecycle/$1" },
{ "command": "remove-lifecycle", "arg": "(stale|frozen)", "action": "remove-label", "label": "lifecycle/$1" }
],
"allowedUsers": [
"ckotzbauer"
]
}

21
.github/labels.json vendored Normal file
View File

@ -0,0 +1,21 @@
[
{ "name": "kind/bug", "color": "#d73a4a", "description": "Categorizes issue or PR as related to a bug." },
{ "name": "kind/feature", "color": "#a2eeef", "description": "Categorizes issue or PR as related to a new feature." },
{ "name": "kind/documentation", "color": "#0075ca", "description": "Categorizes issue or PR as related to documentation." },
{ "name": "kind/test", "color": "#ddc23b", "description": "Categorizes issue or PR as related to tests." },
{ "name": "kind/cleanup", "color": "#ededed", "description": "Categorizes issue or PR as related to cleaning up code, process, or technical debt." },
{ "name": "kind/dependencies", "color": "#ededed", "description": "Pull requests that update a dependency file" },
{ "name": "lifecycle/stale", "color": "#795548", "description": "Denotes an issue or PR has remained open with no activity and has become stale." },
{ "name": "lifecycle/frozen", "color": "#d3e2f0", "description": "Indicates that an issue or PR should not be auto-closed due to staleness." },
{ "name": "size/XS", "color": "#009900", "description": "Denotes a PR that changes 0-9 lines, ignoring generated files." },
{ "name": "size/S", "color": "#77bb00", "description": "Denotes a PR that changes 10-29 lines, ignoring generated files." },
{ "name": "size/M", "color": "#eebb00", "description": "Denotes a PR that changes 30-99 lines, ignoring generated files." },
{ "name": "size/L", "color": "#ee9900", "description": "Denotes a PR that changes 100-499 lines, ignoring generated files." },
{ "name": "size/XL", "color": "#ee5500", "description": "Denotes a PR that changes 500-999 lines, ignoring generated files." },
{ "name": "size/XXL", "color": "#ee0000", "description": "Denotes a PR that changes 1000+ lines, ignoring generated files." },
{ "name": "help wanted", "color": "#008672", "description": "Denotes an issue that needs help from a contributor." },
{ "name": "good first issue", "color": "#7057ff", "description": "Denotes an issue ready for a new contributor." },
{ "name": "approved", "color": "#2fed58", "description": "Indicates a PR has been approved and is ready for merge." },
{ "name": "hold", "color": "#e11d21", "description": "Indicates that a PR should not merge." },
{ "name": "work-in-progress", "color": "#e01dd6", "description": "Indicates that a PR is still in progress." }
]

30
.github/workflows/automerge.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Merge PRs
on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
check_suite:
types:
- completed
status: {}
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: automerge
uses: "pascalgn/automerge-action@f81beb99aef41bb55ad072857d43073fba833a98"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: "approved,!work-in-progress"
MERGE_METHOD: "rebase"
MERGE_DELETE_BRANCH: "true"

View File

@ -0,0 +1,11 @@
name: Create default labels
on: issues
jobs:
labels:
name: DefaultLabelsActions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: lannonbr/issue-label-manager-action@2.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

21
.github/workflows/label-issues.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Label Issues
on:
issue_comment:
types:
- created
- edited
pull_request:
types:
- opened
issues:
types:
- opened
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- name: label
uses: "ckotzbauer/label-command-action@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

10
.github/workflows/size-label.yml vendored Normal file
View File

@ -0,0 +1,10 @@
name: Label size of PRs
on: pull_request
jobs:
size-label:
runs-on: ubuntu-latest
steps:
- name: size-label
uses: "pascalgn/size-label-action@851c37f157f7d64e56f41ff5d2d80316299b2d47"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

19
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Close stale issues
on:
schedule:
- cron: "0 0 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label with `/remove-lifecycle stale` or comment or this will be closed in 5 days.'
stale-pr-message: 'This pull request is stale because it has been open 90 days with no activity. Remove stale label with `/remove-lifecycle stale` or comment or this will be closed in 5 days.'
stale-issue-label: 'lifecycle/stale'
exempt-issue-labels: 'work-in-progress,lifecycle/frozen'
stale-pr-label: 'lifecycle/stale'
exempt-pr-labels: 'work-in-progress,lifecycle/frozen'
days-before-stale: 90
days-before-close: 5

View File

@ -1,37 +0,0 @@
pull_request_rules:
- name: Automatic merge on approval
conditions:
- "#approved-reviews-by>=1"
- status-success=lint-test
- base=master
- label!=work-in-progress
actions:
merge:
method: merge
- name: delete head branch after merge
conditions:
- merged
actions:
delete_head_branch: {}
- name: remove outdated reviews
conditions:
- base=master
actions:
dismiss_reviews: {}
- name: say hi on new contribution
conditions: []
actions:
comment:
message: |
Thanks for your pull request!
The owner of this repository will try to review and merge this as soon as possible.
- name: ask to resolve conflict
conditions:
- conflict
actions:
comment:
message: This pull request has now conflicts with the base branch. Could you please try to fix them? 🙏