Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ci: add gh actions for PR labeling #102

Merged
merged 3 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Config file for the labeler Github Action
# https://hub.docker.com/r/jimschubert/labeler-action
# labeler "full" schema

# enable labeler on issues, prs, or both.
enable:
issues: true
prs: true

# comments object allows you to specify a different message for issues and prs

# comments:
# issues: |
# Thanks for opening this issue!
# I have applied any labels matching special text in your title and description.

# Please review the labels and make any necessary changes.
# prs: |
# Thanks for the contribution!
# I have applied any labels matching special text in your title and description.

# Please review the labels and make any necessary changes.

# Labels is an object where:
# - keys are labels
# - values are objects of { include: [ pattern ], exclude: [ pattern ] }
# - pattern must be a valid regex, and is applied globally to
# title + description of issues and/or prs (see enabled config above)
# - 'include' patterns will associate a label if any of these patterns match
# - 'exclude' patterns will ignore this label if any of these patterns match
labels:
'Type: Fix':
include:
- '^(bug|fix)(\(.*\))?:(.*)'
exclude: []
'Type: Feature':
include:
- '^feat(\(.*\))?:(.*)'
exclude: []
'Type: Build':
include:
- '^build(\(.*\))?:(.*)'
exclude: []
'Type: Documentation':
include:
- '^docs(\(.*\))?:(.*)'
exclude: []
'Type: Refactoring':
include:
- '^(refactor|style)(\(.*\))?:(.*)'
exclude: []
'Type: Testing':
include:
- '^test(\(.*\))?:(.*)'
exclude: []
'Type: Maintenance':
include:
- '^(chore|mnt)(\(.*\))?:(.*)'
exclude: []
'Type: CI':
include:
- '^ci(\(.*\))?:(.*)'
exclude: []
'Type: Performance':
include:
- '^perf(\(.*\))?:(.*)'
exclude: []
'Type: Revert':
include:
- '^revert(\(.*\))?:(.*)'
exclude: []
36 changes: 36 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'Type: Feature'
- 'Type: Performance'
- title: '🐛 Bug Fixes'
labels:
- 'Type: Fix'
- title: '📚 Documentation'
label: 'Type: Documentation'
- title: '🧰 Maintenance'
label:
- 'Type: Maintenance'
- 'Type: Build'
- 'Type: Refactoring'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
exclude-labels:
- 'skip-changelog'
template: |
## Changes

$CHANGES
38 changes: 38 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v2.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Optionally, you can provide options for further constraints.
with:
# Configure which types are allowed.
# Default: https://github.com/commitizen/conventional-commit-types
types: |
feat
fix
build
docs
style
refactor
chore
ci
perf
revert
test
# Configure which scopes are allowed.
# scopes: |
# core
# ui
# Configure that a scope must always be provided.
# requireScope: true
18 changes: 18 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Label PRs and issues
on:
issues:
types: [opened, edited, milestoned]
pull_request_target:
types: [opened]

jobs:

labeler:
runs-on: ubuntu-latest

steps:
- name: Check Labels
id: labeler
uses: jimschubert/labeler-action@v2
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
19 changes: 19 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# config-name: my-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}