Skip to content

Commit

Permalink
Merge pull request #8 from netgroup/add-release-drafter-github-action
Browse files Browse the repository at this point in the history
Add Release Drafter GitHub action to automate the creation of release drafts
  • Loading branch information
cscarpitta authored Jun 23, 2020
2 parents 78f7b24 + 2662e0c commit fc92444
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- regExp: ".*\\.ts+$"
labels: ["typescript"]
- regExp: ".*\\.sql+$"
labels: ["database", "critical"]
- regExp: ".*/docs/"
labels: ["documentation"]
- regExp: ".*\\.png+$"
labels: ["images"]
- regExp: "^(pom\\.xml|package\\.json|build\\.gradle)$"
labels: ["dependencies"]
- regExp: ".*/requirements.txt"
labels: ["dependencies"]
- regExp: ".*\\.(zip|jar|war|ear)+$"
labels: ["artifact", "invalid"]
- regExp: ".*/setup.py"
labels: ["build"]
- regExp: "^.github/"
labels: ["github-workflow"]
- regExp: ".*/.env"
labels: ["configuration"]
3 changes: 3 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
feature: ['feature/*', 'feat/*', 'feature-*', 'feat-*']
bug: ['fix/*', 'fix-*']
chore: ['chore/*', 'chore-*']
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:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'feature'
- 'enhancement'
patch:
labels:
- 'patch'
- 'fix'
- 'bugfix'
- 'bug'
default: patch
exclude-labels:
- 'skip-changelog'
template: |
## Changes
$CHANGES
27 changes: 27 additions & 0 deletions .github/workflows/pr_labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Workflow to associate labels automatically
name: labeler

# Trigger the workflow on pull request events
on: [pull_request]

jobs:
label:
runs-on: ubuntu-latest
steps:
# We need to checkout the repository to access the configured file (.github/label-pr.yml)
- uses: actions/checkout@v2
- name: Labeler
uses: docker://decathlon/pull-request-labeler-action:2.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Here we can override the path for the action configuration. If none is provided, default one is `.github/label-pr.yml`
# CONFIG_PATH: ${{ secrets.GITHUB_WORKSPACE }}/.github/label-pr.yml

pr-labeler:
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v3
# with:
# configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
env:
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 }}

0 comments on commit fc92444

Please sign in to comment.