Skip to content

Commit

Permalink
feat: stop writing your changelogs manually
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Jul 4, 2023
1 parent 015c906 commit c4de87b
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This release drafter follows the conventions
# from https://keepachangelog.com

name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
template: |
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: 🚀 Added Features
labels:
- feat
- feature
- enhancement
- title: 🪲 Fixed Bugs
labels:
- fix
- bug
- title: ⚠️ Changed
labels:
- changed
- title: ⛔️ Deprecated
labels:
- deprecated
- title: 🗑 Removed
labels:
- removed
- title: 🔐 Security
labels:
- security
- title: 📓 Documentation
labels:
- docs
- documentation
- title: 🧩 Updated
labels:
- deps
- dependencies
collapse-after: 5

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:
- chore
- skip-changelog
35 changes: 35 additions & 0 deletions .github/workflows/label-checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Label Checker

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
check_semver_labels:
name: Check Semver labels
runs-on: [ self-hosted ]

steps:
- name: Check for Semver labels
uses: danielchabr/pr-labels-checker@v3.1
with:
hasSome: major,minor,patch
githubToken: ${{ secrets.GITHUB_TOKEN }}

check_cc_labels:
name: Check conventional commits labels
runs-on: [ self-hosted ]
steps:
- uses: danielchabr/pr-labels-checker@v3.1
with:
hasSome: feat,feature,enhancement,fix,bug,changed,deprecated,removed,security,docs,deps,dependencies
githubToken: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/pr-title-checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check PR title

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
title-checker:
name: Check PR title
runs-on: [ self-hosted ]

steps:
- uses: aslafy-z/conventional-pr-title-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release Drafter

on:
push:
branches:
- feat/release-notes

jobs:
update_release_draft:
name: Release drafter
runs-on: ubuntu-latest

steps:
- name: Update Release Draft
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/update-changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Update Changelog

on:
release:
types:
- released

jobs:
update:
name: Update Changelog
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated Changelog
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: 'docs(changelog): update changelog'
file_pattern: CHANGELOG.md

0 comments on commit c4de87b

Please sign in to comment.